|
4406.c435ee1d9e07c37b46e4.js
|
1 (self["webpackChunk_JUPYTERLAB_CORE_OUTPUT"] = self["webpackChunk_JUPYTERLAB_CORE_OUTPUT"] || []).push([[4406],{
2
3 /***/ 2091:
4 /***/ ((__unused_webpack_module, exports) => {
5
6 "use strict";
7
8 Object.defineProperty(exports, "__esModule", ({ value: true }));
9 exports.BLANK_URL = exports.relativeFirstCharacters = exports.whitespaceEscapeCharsRegex = exports.urlSchemeRegex = exports.ctrlCharactersRegex = exports.htmlCtrlEntityRegex = exports.htmlEntitiesRegex = exports.invalidProtocolRegex = void 0;
10 exports.invalidProtocolRegex = /^([^\w]*)(javascript|data|vbscript)/im;
11 exports.htmlEntitiesRegex = /&#(\w+)(^\w|;)?/g;
12 exports.htmlCtrlEntityRegex = /&(newline|tab);/gi;
13 exports.ctrlCharactersRegex = /[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim;
14 exports.urlSchemeRegex = /^.+(:|:)/gim;
15 exports.whitespaceEscapeCharsRegex = /(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g;
16 exports.relativeFirstCharacters = [".", "/"];
17 exports.BLANK_URL = "about:blank";
18
19
20 /***/ }),
21
22 /***/ 7608:
23 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
24
25 "use strict";
26 var __webpack_unused_export__;
27
28 __webpack_unused_export__ = ({ value: true });
29 exports.N = void 0;
30 var constants_1 = __webpack_require__(2091);
31 function isRelativeUrlWithoutProtocol(url) {
32 return constants_1.relativeFirstCharacters.indexOf(url[0]) > -1;
33 }
34 function decodeHtmlCharacters(str) {
35 var removedNullByte = str.replace(constants_1.ctrlCharactersRegex, "");
36 return removedNullByte.replace(constants_1.htmlEntitiesRegex, function (match, dec) {
37 return String.fromCharCode(dec);
38 });
39 }
40 function isValidUrl(url) {
41 return URL.canParse(url);
42 }
43 function decodeURI(uri) {
44 try {
45 return decodeURIComponent(uri);
46 }
47 catch (e) {
48 // Ignoring error
49 // It is possible that the URI contains a `%` not associated
50 // with URI/URL-encoding.
51 return uri;
52 }
53 }
54 function sanitizeUrl(url) {
55 if (!url) {
56 return constants_1.BLANK_URL;
57 }
58 var charsToDecode;
59 var decodedUrl = decodeURI(url.trim());
60 do {
61 decodedUrl = decodeHtmlCharacters(decodedUrl)
62 .replace(constants_1.htmlCtrlEntityRegex, "")
63 .replace(constants_1.ctrlCharactersRegex, "")
64 .replace(constants_1.whitespaceEscapeCharsRegex, "")
65 .trim();
66 decodedUrl = decodeURI(decodedUrl);
67 charsToDecode =
68 decodedUrl.match(constants_1.ctrlCharactersRegex) ||
69 decodedUrl.match(constants_1.htmlEntitiesRegex) ||
70 decodedUrl.match(constants_1.htmlCtrlEntityRegex) ||
71 decodedUrl.match(constants_1.whitespaceEscapeCharsRegex);
72 } while (charsToDecode && charsToDecode.length > 0);
73 var sanitizedUrl = decodedUrl;
74 if (!sanitizedUrl) {
75 return constants_1.BLANK_URL;
76 }
77 if (isRelativeUrlWithoutProtocol(sanitizedUrl)) {
78 return sanitizedUrl;
79 }
80 // Remove any leading whitespace before checking the URL scheme
81 var trimmedUrl = sanitizedUrl.trimStart();
82 var urlSchemeParseResults = trimmedUrl.match(constants_1.urlSchemeRegex);
83 if (!urlSchemeParseResults) {
84 return sanitizedUrl;
85 }
86 var urlScheme = urlSchemeParseResults[0].toLowerCase().trim();
87 if (constants_1.invalidProtocolRegex.test(urlScheme)) {
88 return constants_1.BLANK_URL;
89 }
90 var backSanitized = trimmedUrl.replace(/\\/g, "/");
91 // Handle special cases for mailto: and custom deep-link protocols
92 if (urlScheme === "mailto:" || urlScheme.includes("://")) {
93 return backSanitized;
94 }
95 // For http and https URLs, perform additional validation
96 if (urlScheme === "http:" || urlScheme === "https:") {
97 if (!isValidUrl(backSanitized)) {
98 return constants_1.BLANK_URL;
99 }
100 var url_1 = new URL(backSanitized);
101 url_1.protocol = url_1.protocol.toLowerCase();
102 url_1.hostname = url_1.hostname.toLowerCase();
103 return url_1.toString();
104 }
105 return backSanitized;
106 }
107 exports.N = sanitizeUrl;
108
109
110 /***/ }),
111
112 /***/ 27693:
113 /***/ (function(module) {
114
115 !function(t,e){ true?module.exports=e():0}(this,(function(){"use strict";var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return+(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return b},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return b.s(e.$y,4,"0");case"M":return a+1;case"MM":return b.s(a+1,2,"0");case"MMM":return h(n.monthsShort,a,c,3);case"MMMM":return h(c,a);case"D":return e.$D;case"DD":return b.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(n.weekdaysMin,e.$W,o,2);case"ddd":return h(n.weekdaysShort,e.$W,o,3);case"dddd":return o[e.$W];case"H":return String(s);case"HH":return b.s(s,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return $(s,u,!0);case"A":return $(s,u,!1);case"m":return String(u);case"mm":return b.s(u,2,"0");case"s":return String(e.$s);case"ss":return b.s(e.$s,2,"0");case"SSS":return b.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));
116
117 /***/ }),
118
119 /***/ 4719:
120 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
121
122 "use strict";
123 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
124 /* harmony export */ Z: () => (/* binding */ purify)
125 /* harmony export */ });
126 /*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */
127
128 const {
129 entries,
130 setPrototypeOf,
131 isFrozen,
132 getPrototypeOf,
133 getOwnPropertyDescriptor
134 } = Object;
135 let {
136 freeze,
137 seal,
138 create
139 } = Object; // eslint-disable-line import/no-mutable-exports
140 let {
141 apply,
142 construct
143 } = typeof Reflect !== 'undefined' && Reflect;
144 if (!freeze) {
145 freeze = function freeze(x) {
146 return x;
147 };
148 }
149 if (!seal) {
150 seal = function seal(x) {
151 return x;
152 };
153 }
154 if (!apply) {
155 apply = function apply(fun, thisValue, args) {
156 return fun.apply(thisValue, args);
157 };
158 }
159 if (!construct) {
160 construct = function construct(Func, args) {
161 return new Func(...args);
162 };
163 }
164 const arrayForEach = unapply(Array.prototype.forEach);
165 const arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
166 const arrayPop = unapply(Array.prototype.pop);
167 const arrayPush = unapply(Array.prototype.push);
168 const arraySplice = unapply(Array.prototype.splice);
169 const stringToLowerCase = unapply(String.prototype.toLowerCase);
170 const stringToString = unapply(String.prototype.toString);
171 const stringMatch = unapply(String.prototype.match);
172 const stringReplace = unapply(String.prototype.replace);
173 const stringIndexOf = unapply(String.prototype.indexOf);
174 const stringTrim = unapply(String.prototype.trim);
175 const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);
176 const regExpTest = unapply(RegExp.prototype.test);
177 const typeErrorCreate = unconstruct(TypeError);
178 /**
179 * Creates a new function that calls the given function with a specified thisArg and arguments.
180 *
181 * @param func - The function to be wrapped and called.
182 * @returns A new function that calls the given function with a specified thisArg and arguments.
183 */
184 function unapply(func) {
185 return function (thisArg) {
186 for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
187 args[_key - 1] = arguments[_key];
188 }
189 return apply(func, thisArg, args);
190 };
191 }
192 /**
193 * Creates a new function that constructs an instance of the given constructor function with the provided arguments.
194 *
195 * @param func - The constructor function to be wrapped and called.
196 * @returns A new function that constructs an instance of the given constructor function with the provided arguments.
197 */
198 function unconstruct(func) {
199 return function () {
200 for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
201 args[_key2] = arguments[_key2];
202 }
203 return construct(func, args);
204 };
205 }
206 /**
207 * Add properties to a lookup table
208 *
209 * @param set - The set to which elements will be added.
210 * @param array - The array containing elements to be added to the set.
211 * @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.
212 * @returns The modified set with added elements.
213 */
214 function addToSet(set, array) {
215 let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;
216 if (setPrototypeOf) {
217 // Make 'in' and truthy checks like Boolean(set.constructor)
218 // independent of any properties defined on Object.prototype.
219 // Prevent prototype setters from intercepting set as a this value.
220 setPrototypeOf(set, null);
221 }
222 let l = array.length;
223 while (l--) {
224 let element = array[l];
225 if (typeof element === 'string') {
226 const lcElement = transformCaseFunc(element);
227 if (lcElement !== element) {
228 // Config presets (e.g. tags.js, attrs.js) are immutable.
229 if (!isFrozen(array)) {
230 array[l] = lcElement;
231 }
232 element = lcElement;
233 }
234 }
235 set[element] = true;
236 }
237 return set;
238 }
239 /**
240 * Clean up an array to harden against CSPP
241 *
242 * @param array - The array to be cleaned.
243 * @returns The cleaned version of the array
244 */
245 function cleanArray(array) {
246 for (let index = 0; index < array.length; index++) {
247 const isPropertyExist = objectHasOwnProperty(array, index);
248 if (!isPropertyExist) {
249 array[index] = null;
250 }
251 }
252 return array;
253 }
254 /**
255 * Shallow clone an object
256 *
257 * @param object - The object to be cloned.
258 * @returns A new object that copies the original.
259 */
260 function clone(object) {
261 const newObject = create(null);
262 for (const [property, value] of entries(object)) {
263 const isPropertyExist = objectHasOwnProperty(object, property);
264 if (isPropertyExist) {
265 if (Array.isArray(value)) {
266 newObject[property] = cleanArray(value);
267 } else if (value && typeof value === 'object' && value.constructor === Object) {
268 newObject[property] = clone(value);
269 } else {
270 newObject[property] = value;
271 }
272 }
273 }
274 return newObject;
275 }
276 /**
277 * This method automatically checks if the prop is function or getter and behaves accordingly.
278 *
279 * @param object - The object to look up the getter function in its prototype chain.
280 * @param prop - The property name for which to find the getter function.
281 * @returns The getter function found in the prototype chain or a fallback function.
282 */
283 function lookupGetter(object, prop) {
284 while (object !== null) {
285 const desc = getOwnPropertyDescriptor(object, prop);
286 if (desc) {
287 if (desc.get) {
288 return unapply(desc.get);
289 }
290 if (typeof desc.value === 'function') {
291 return unapply(desc.value);
292 }
293 }
294 object = getPrototypeOf(object);
295 }
296 function fallbackValue() {
297 return null;
298 }
299 return fallbackValue;
300 }
301
302 const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);
303 const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);
304 const svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);
305 // List of SVG elements that are disallowed by default.
306 // We still need to know them so that we can do namespace
307 // checks properly in case one wants to add them to
308 // allow-list.
309 const svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);
310 const mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']);
311 // Similarly to SVG, we want to know all MathML elements,
312 // even those that we disallow by default.
313 const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);
314 const text = freeze(['#text']);
315
316 const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']);
317 const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);
318 const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);
319 const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);
320
321 // eslint-disable-next-line unicorn/better-regex
322 const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode
323 const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
324 const TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm); // eslint-disable-line unicorn/better-regex
325 const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/); // eslint-disable-line no-useless-escape
326 const ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape
327 const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape
328 );
329 const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
330 const ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g // eslint-disable-line no-control-regex
331 );
332 const DOCTYPE_NAME = seal(/^html$/i);
333 const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
334
335 var EXPRESSIONS = /*#__PURE__*/Object.freeze({
336 __proto__: null,
337 ARIA_ATTR: ARIA_ATTR,
338 ATTR_WHITESPACE: ATTR_WHITESPACE,
339 CUSTOM_ELEMENT: CUSTOM_ELEMENT,
340 DATA_ATTR: DATA_ATTR,
341 DOCTYPE_NAME: DOCTYPE_NAME,
342 ERB_EXPR: ERB_EXPR,
343 IS_ALLOWED_URI: IS_ALLOWED_URI,
344 IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,
345 MUSTACHE_EXPR: MUSTACHE_EXPR,
346 TMPLIT_EXPR: TMPLIT_EXPR
347 });
348
349 /* eslint-disable @typescript-eslint/indent */
350 // https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType
351 const NODE_TYPE = {
352 element: 1,
353 attribute: 2,
354 text: 3,
355 cdataSection: 4,
356 entityReference: 5,
357 // Deprecated
358 entityNode: 6,
359 // Deprecated
360 progressingInstruction: 7,
361 comment: 8,
362 document: 9,
363 documentType: 10,
364 documentFragment: 11,
365 notation: 12 // Deprecated
366 };
367 const getGlobal = function getGlobal() {
368 return typeof window === 'undefined' ? null : window;
369 };
370 /**
371 * Creates a no-op policy for internal use only.
372 * Don't export this function outside this module!
373 * @param trustedTypes The policy factory.
374 * @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).
375 * @return The policy created (or null, if Trusted Types
376 * are not supported or creating the policy failed).
377 */
378 const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {
379 if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {
380 return null;
381 }
382 // Allow the callers to control the unique policy name
383 // by adding a data-tt-policy-suffix to the script element with the DOMPurify.
384 // Policy creation with duplicate names throws in Trusted Types.
385 let suffix = null;
386 const ATTR_NAME = 'data-tt-policy-suffix';
387 if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {
388 suffix = purifyHostElement.getAttribute(ATTR_NAME);
389 }
390 const policyName = 'dompurify' + (suffix ? '#' + suffix : '');
391 try {
392 return trustedTypes.createPolicy(policyName, {
393 createHTML(html) {
394 return html;
395 },
396 createScriptURL(scriptUrl) {
397 return scriptUrl;
398 }
399 });
400 } catch (_) {
401 // Policy creation failed (most likely another DOMPurify script has
402 // already run). Skip creating the policy, as this will only cause errors
403 // if TT are enforced.
404 console.warn('TrustedTypes policy ' + policyName + ' could not be created.');
405 return null;
406 }
407 };
408 const _createHooksMap = function _createHooksMap() {
409 return {
410 afterSanitizeAttributes: [],
411 afterSanitizeElements: [],
412 afterSanitizeShadowDOM: [],
413 beforeSanitizeAttributes: [],
414 beforeSanitizeElements: [],
415 beforeSanitizeShadowDOM: [],
416 uponSanitizeAttribute: [],
417 uponSanitizeElement: [],
418 uponSanitizeShadowNode: []
419 };
420 };
421 function createDOMPurify() {
422 let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
423 const DOMPurify = root => createDOMPurify(root);
424 DOMPurify.version = '3.2.4';
425 DOMPurify.removed = [];
426 if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
427 // Not running in a browser, provide a factory function
428 // so that you can pass your own Window
429 DOMPurify.isSupported = false;
430 return DOMPurify;
431 }
432 let {
433 document
434 } = window;
435 const originalDocument = document;
436 const currentScript = originalDocument.currentScript;
437 const {
438 DocumentFragment,
439 HTMLTemplateElement,
440 Node,
441 Element,
442 NodeFilter,
443 NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,
444 HTMLFormElement,
445 DOMParser,
446 trustedTypes
447 } = window;
448 const ElementPrototype = Element.prototype;
449 const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');
450 const remove = lookupGetter(ElementPrototype, 'remove');
451 const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');
452 const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');
453 const getParentNode = lookupGetter(ElementPrototype, 'parentNode');
454 // As per issue #47, the web-components registry is inherited by a
455 // new document created via createHTMLDocument. As per the spec
456 // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)
457 // a new empty registry is used when creating a template contents owner
458 // document, so we use that as our parent document to ensure nothing
459 // is inherited.
460 if (typeof HTMLTemplateElement === 'function') {
461 const template = document.createElement('template');
462 if (template.content && template.content.ownerDocument) {
463 document = template.content.ownerDocument;
464 }
465 }
466 let trustedTypesPolicy;
467 let emptyHTML = '';
468 const {
469 implementation,
470 createNodeIterator,
471 createDocumentFragment,
472 getElementsByTagName
473 } = document;
474 const {
475 importNode
476 } = originalDocument;
477 let hooks = _createHooksMap();
478 /**
479 * Expose whether this browser supports running the full DOMPurify.
480 */
481 DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;
482 const {
483 MUSTACHE_EXPR,
484 ERB_EXPR,
485 TMPLIT_EXPR,
486 DATA_ATTR,
487 ARIA_ATTR,
488 IS_SCRIPT_OR_DATA,
489 ATTR_WHITESPACE,
490 CUSTOM_ELEMENT
491 } = EXPRESSIONS;
492 let {
493 IS_ALLOWED_URI: IS_ALLOWED_URI$1
494 } = EXPRESSIONS;
495 /**
496 * We consider the elements and attributes below to be safe. Ideally
497 * don't add any new ones but feel free to remove unwanted ones.
498 */
499 /* allowed element names */
500 let ALLOWED_TAGS = null;
501 const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);
502 /* Allowed attribute names */
503 let ALLOWED_ATTR = null;
504 const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);
505 /*
506 * Configure how DOMPurify should handle custom elements and their attributes as well as customized built-in elements.
507 * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)
508 * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)
509 * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.
510 */
511 let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {
512 tagNameCheck: {
513 writable: true,
514 configurable: false,
515 enumerable: true,
516 value: null
517 },
518 attributeNameCheck: {
519 writable: true,
520 configurable: false,
521 enumerable: true,
522 value: null
523 },
524 allowCustomizedBuiltInElements: {
525 writable: true,
526 configurable: false,
527 enumerable: true,
528 value: false
529 }
530 }));
531 /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */
532 let FORBID_TAGS = null;
533 /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */
534 let FORBID_ATTR = null;
535 /* Decide if ARIA attributes are okay */
536 let ALLOW_ARIA_ATTR = true;
537 /* Decide if custom data attributes are okay */
538 let ALLOW_DATA_ATTR = true;
539 /* Decide if unknown protocols are okay */
540 let ALLOW_UNKNOWN_PROTOCOLS = false;
541 /* Decide if self-closing tags in attributes are allowed.
542 * Usually removed due to a mXSS issue in jQuery 3.0 */
543 let ALLOW_SELF_CLOSE_IN_ATTR = true;
544 /* Output should be safe for common template engines.
545 * This means, DOMPurify removes data attributes, mustaches and ERB
546 */
547 let SAFE_FOR_TEMPLATES = false;
548 /* Output should be safe even for XML used within HTML and alike.
549 * This means, DOMPurify removes comments when containing risky content.
550 */
551 let SAFE_FOR_XML = true;
552 /* Decide if document with <html>... should be returned */
553 let WHOLE_DOCUMENT = false;
554 /* Track whether config is already set on this instance of DOMPurify. */
555 let SET_CONFIG = false;
556 /* Decide if all elements (e.g. style, script) must be children of
557 * document.body. By default, browsers might move them to document.head */
558 let FORCE_BODY = false;
559 /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html
560 * string (or a TrustedHTML object if Trusted Types are supported).
561 * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead
562 */
563 let RETURN_DOM = false;
564 /* Decide if a DOM `DocumentFragment` should be returned, instead of a html
565 * string (or a TrustedHTML object if Trusted Types are supported) */
566 let RETURN_DOM_FRAGMENT = false;
567 /* Try to return a Trusted Type object instead of a string, return a string in
568 * case Trusted Types are not supported */
569 let RETURN_TRUSTED_TYPE = false;
570 /* Output should be free from DOM clobbering attacks?
571 * This sanitizes markups named with colliding, clobberable built-in DOM APIs.
572 */
573 let SANITIZE_DOM = true;
574 /* Achieve full DOM Clobbering protection by isolating the namespace of named
575 * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.
576 *
577 * HTML/DOM spec rules that enable DOM Clobbering:
578 * - Named Access on Window (§7.3.3)
579 * - DOM Tree Accessors (§3.1.5)
580 * - Form Element Parent-Child Relations (§4.10.3)
581 * - Iframe srcdoc / Nested WindowProxies (§4.8.5)
582 * - HTMLCollection (§4.2.10.2)
583 *
584 * Namespace isolation is implemented by prefixing `id` and `name` attributes
585 * with a constant string, i.e., `user-content-`
586 */
587 let SANITIZE_NAMED_PROPS = false;
588 const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';
589 /* Keep element content when removing element? */
590 let KEEP_CONTENT = true;
591 /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead
592 * of importing it into a new Document and returning a sanitized copy */
593 let IN_PLACE = false;
594 /* Allow usage of profiles like html, svg and mathMl */
595 let USE_PROFILES = {};
596 /* Tags to ignore content of when KEEP_CONTENT is true */
597 let FORBID_CONTENTS = null;
598 const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);
599 /* Tags that are safe for data: URIs */
600 let DATA_URI_TAGS = null;
601 const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);
602 /* Attributes safe for values like "javascript:" */
603 let URI_SAFE_ATTRIBUTES = null;
604 const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);
605 const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
606 const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
607 const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
608 /* Document namespace */
609 let NAMESPACE = HTML_NAMESPACE;
610 let IS_EMPTY_INPUT = false;
611 /* Allowed XHTML+XML namespaces */
612 let ALLOWED_NAMESPACES = null;
613 const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
614 let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);
615 let HTML_INTEGRATION_POINTS = addToSet({}, ['annotation-xml']);
616 // Certain elements are allowed in both SVG and HTML
617 // namespace. We need to specify them explicitly
618 // so that they don't get erroneously deleted from
619 // HTML namespace.
620 const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);
621 /* Parsing of strict XHTML documents */
622 let PARSER_MEDIA_TYPE = null;
623 const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];
624 const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';
625 let transformCaseFunc = null;
626 /* Keep a reference to config to pass to hooks */
627 let CONFIG = null;
628 /* Ideally, do not touch anything below this line */
629 /* ______________________________________________ */
630 const formElement = document.createElement('form');
631 const isRegexOrFunction = function isRegexOrFunction(testValue) {
632 return testValue instanceof RegExp || testValue instanceof Function;
633 };
634 /**
635 * _parseConfig
636 *
637 * @param cfg optional config literal
638 */
639 // eslint-disable-next-line complexity
640 const _parseConfig = function _parseConfig() {
641 let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
642 if (CONFIG && CONFIG === cfg) {
643 return;
644 }
645 /* Shield configuration object from tampering */
646 if (!cfg || typeof cfg !== 'object') {
647 cfg = {};
648 }
649 /* Shield configuration object from prototype pollution */
650 cfg = clone(cfg);
651 PARSER_MEDIA_TYPE =
652 // eslint-disable-next-line unicorn/prefer-includes
653 SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;
654 // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.
655 transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;
656 /* Set configuration parameters */
657 ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS') ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;
658 ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR') ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;
659 ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES') ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;
660 URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES;
661 DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS') ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS;
662 FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS') ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
663 FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};
664 FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};
665 USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES : false;
666 ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true
667 ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true
668 ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false
669 ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true
670 SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false
671 SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true
672 WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false
673 RETURN_DOM = cfg.RETURN_DOM || false; // Default false
674 RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false
675 RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false
676 FORCE_BODY = cfg.FORCE_BODY || false; // Default false
677 SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true
678 SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false
679 KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true
680 IN_PLACE = cfg.IN_PLACE || false; // Default false
681 IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;
682 NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;
683 MATHML_TEXT_INTEGRATION_POINTS = cfg.MATHML_TEXT_INTEGRATION_POINTS || MATHML_TEXT_INTEGRATION_POINTS;
684 HTML_INTEGRATION_POINTS = cfg.HTML_INTEGRATION_POINTS || HTML_INTEGRATION_POINTS;
685 CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};
686 if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {
687 CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;
688 }
689 if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {
690 CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;
691 }
692 if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') {
693 CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;
694 }
695 if (SAFE_FOR_TEMPLATES) {
696 ALLOW_DATA_ATTR = false;
697 }
698 if (RETURN_DOM_FRAGMENT) {
699 RETURN_DOM = true;
700 }
701 /* Parse profile info */
702 if (USE_PROFILES) {
703 ALLOWED_TAGS = addToSet({}, text);
704 ALLOWED_ATTR = [];
705 if (USE_PROFILES.html === true) {
706 addToSet(ALLOWED_TAGS, html$1);
707 addToSet(ALLOWED_ATTR, html);
708 }
709 if (USE_PROFILES.svg === true) {
710 addToSet(ALLOWED_TAGS, svg$1);
711 addToSet(ALLOWED_ATTR, svg);
712 addToSet(ALLOWED_ATTR, xml);
713 }
714 if (USE_PROFILES.svgFilters === true) {
715 addToSet(ALLOWED_TAGS, svgFilters);
716 addToSet(ALLOWED_ATTR, svg);
717 addToSet(ALLOWED_ATTR, xml);
718 }
719 if (USE_PROFILES.mathMl === true) {
720 addToSet(ALLOWED_TAGS, mathMl$1);
721 addToSet(ALLOWED_ATTR, mathMl);
722 addToSet(ALLOWED_ATTR, xml);
723 }
724 }
725 /* Merge configuration parameters */
726 if (cfg.ADD_TAGS) {
727 if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
728 ALLOWED_TAGS = clone(ALLOWED_TAGS);
729 }
730 addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
731 }
732 if (cfg.ADD_ATTR) {
733 if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
734 ALLOWED_ATTR = clone(ALLOWED_ATTR);
735 }
736 addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
737 }
738 if (cfg.ADD_URI_SAFE_ATTR) {
739 addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
740 }
741 if (cfg.FORBID_CONTENTS) {
742 if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
743 FORBID_CONTENTS = clone(FORBID_CONTENTS);
744 }
745 addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
746 }
747 /* Add #text in case KEEP_CONTENT is set to true */
748 if (KEEP_CONTENT) {
749 ALLOWED_TAGS['#text'] = true;
750 }
751 /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */
752 if (WHOLE_DOCUMENT) {
753 addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);
754 }
755 /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */
756 if (ALLOWED_TAGS.table) {
757 addToSet(ALLOWED_TAGS, ['tbody']);
758 delete FORBID_TAGS.tbody;
759 }
760 if (cfg.TRUSTED_TYPES_POLICY) {
761 if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {
762 throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
763 }
764 if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {
765 throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
766 }
767 // Overwrite existing TrustedTypes policy.
768 trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
769 // Sign local variables required by `sanitize`.
770 emptyHTML = trustedTypesPolicy.createHTML('');
771 } else {
772 // Uninitialized policy, attempt to initialize the internal dompurify policy.
773 if (trustedTypesPolicy === undefined) {
774 trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
775 }
776 // If creating the internal policy succeeded sign internal variables.
777 if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {
778 emptyHTML = trustedTypesPolicy.createHTML('');
779 }
780 }
781 // Prevent further manipulation of configuration.
782 // Not available in IE8, Safari 5, etc.
783 if (freeze) {
784 freeze(cfg);
785 }
786 CONFIG = cfg;
787 };
788 /* Keep track of all possible SVG and MathML tags
789 * so that we can perform the namespace checks
790 * correctly. */
791 const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);
792 const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
793 /**
794 * @param element a DOM element whose namespace is being checked
795 * @returns Return false if the element has a
796 * namespace that a spec-compliant parser would never
797 * return. Return true otherwise.
798 */
799 const _checkValidNamespace = function _checkValidNamespace(element) {
800 let parent = getParentNode(element);
801 // In JSDOM, if we're inside shadow DOM, then parentNode
802 // can be null. We just simulate parent in this case.
803 if (!parent || !parent.tagName) {
804 parent = {
805 namespaceURI: NAMESPACE,
806 tagName: 'template'
807 };
808 }
809 const tagName = stringToLowerCase(element.tagName);
810 const parentTagName = stringToLowerCase(parent.tagName);
811 if (!ALLOWED_NAMESPACES[element.namespaceURI]) {
812 return false;
813 }
814 if (element.namespaceURI === SVG_NAMESPACE) {
815 // The only way to switch from HTML namespace to SVG
816 // is via <svg>. If it happens via any other tag, then
817 // it should be killed.
818 if (parent.namespaceURI === HTML_NAMESPACE) {
819 return tagName === 'svg';
820 }
821 // The only way to switch from MathML to SVG is via`
822 // svg if parent is either <annotation-xml> or MathML
823 // text integration points.
824 if (parent.namespaceURI === MATHML_NAMESPACE) {
825 return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
826 }
827 // We only allow elements that are defined in SVG
828 // spec. All others are disallowed in SVG namespace.
829 return Boolean(ALL_SVG_TAGS[tagName]);
830 }
831 if (element.namespaceURI === MATHML_NAMESPACE) {
832 // The only way to switch from HTML namespace to MathML
833 // is via <math>. If it happens via any other tag, then
834 // it should be killed.
835 if (parent.namespaceURI === HTML_NAMESPACE) {
836 return tagName === 'math';
837 }
838 // The only way to switch from SVG to MathML is via
839 // <math> and HTML integration points
840 if (parent.namespaceURI === SVG_NAMESPACE) {
841 return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];
842 }
843 // We only allow elements that are defined in MathML
844 // spec. All others are disallowed in MathML namespace.
845 return Boolean(ALL_MATHML_TAGS[tagName]);
846 }
847 if (element.namespaceURI === HTML_NAMESPACE) {
848 // The only way to switch from SVG to HTML is via
849 // HTML integration points, and from MathML to HTML
850 // is via MathML text integration points
851 if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
852 return false;
853 }
854 if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
855 return false;
856 }
857 // We disallow tags that are specific for MathML
858 // or SVG and should never appear in HTML namespace
859 return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
860 }
861 // For XHTML and XML documents that support custom namespaces
862 if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {
863 return true;
864 }
865 // The code should never reach this place (this means
866 // that the element somehow got namespace that is not
867 // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).
868 // Return false just in case.
869 return false;
870 };
871 /**
872 * _forceRemove
873 *
874 * @param node a DOM node
875 */
876 const _forceRemove = function _forceRemove(node) {
877 arrayPush(DOMPurify.removed, {
878 element: node
879 });
880 try {
881 // eslint-disable-next-line unicorn/prefer-dom-node-remove
882 getParentNode(node).removeChild(node);
883 } catch (_) {
884 remove(node);
885 }
886 };
887 /**
888 * _removeAttribute
889 *
890 * @param name an Attribute name
891 * @param element a DOM node
892 */
893 const _removeAttribute = function _removeAttribute(name, element) {
894 try {
895 arrayPush(DOMPurify.removed, {
896 attribute: element.getAttributeNode(name),
897 from: element
898 });
899 } catch (_) {
900 arrayPush(DOMPurify.removed, {
901 attribute: null,
902 from: element
903 });
904 }
905 element.removeAttribute(name);
906 // We void attribute values for unremovable "is" attributes
907 if (name === 'is') {
908 if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
909 try {
910 _forceRemove(element);
911 } catch (_) {}
912 } else {
913 try {
914 element.setAttribute(name, '');
915 } catch (_) {}
916 }
917 }
918 };
919 /**
920 * _initDocument
921 *
922 * @param dirty - a string of dirty markup
923 * @return a DOM, filled with the dirty markup
924 */
925 const _initDocument = function _initDocument(dirty) {
926 /* Create a HTML document */
927 let doc = null;
928 let leadingWhitespace = null;
929 if (FORCE_BODY) {
930 dirty = '<remove></remove>' + dirty;
931 } else {
932 /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */
933 const matches = stringMatch(dirty, /^[\r\n\t ]+/);
934 leadingWhitespace = matches && matches[0];
935 }
936 if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {
937 // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)
938 dirty = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + dirty + '</body></html>';
939 }
940 const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;
941 /*
942 * Use the DOMParser API by default, fallback later if needs be
943 * DOMParser not work for svg when has multiple root element.
944 */
945 if (NAMESPACE === HTML_NAMESPACE) {
946 try {
947 doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
948 } catch (_) {}
949 }
950 /* Use createHTMLDocument in case DOMParser is not available */
951 if (!doc || !doc.documentElement) {
952 doc = implementation.createDocument(NAMESPACE, 'template', null);
953 try {
954 doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;
955 } catch (_) {
956 // Syntax error if dirtyPayload is invalid xml
957 }
958 }
959 const body = doc.body || doc.documentElement;
960 if (dirty && leadingWhitespace) {
961 body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);
962 }
963 /* Work on whole document or just its body */
964 if (NAMESPACE === HTML_NAMESPACE) {
965 return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];
966 }
967 return WHOLE_DOCUMENT ? doc.documentElement : body;
968 };
969 /**
970 * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.
971 *
972 * @param root The root element or node to start traversing on.
973 * @return The created NodeIterator
974 */
975 const _createNodeIterator = function _createNodeIterator(root) {
976 return createNodeIterator.call(root.ownerDocument || root, root,
977 // eslint-disable-next-line no-bitwise
978 NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);
979 };
980 /**
981 * _isClobbered
982 *
983 * @param element element to check for clobbering attacks
984 * @return true if clobbered, false if safe
985 */
986 const _isClobbered = function _isClobbered(element) {
987 return element instanceof HTMLFormElement && (typeof element.nodeName !== 'string' || typeof element.textContent !== 'string' || typeof element.removeChild !== 'function' || !(element.attributes instanceof NamedNodeMap) || typeof element.removeAttribute !== 'function' || typeof element.setAttribute !== 'function' || typeof element.namespaceURI !== 'string' || typeof element.insertBefore !== 'function' || typeof element.hasChildNodes !== 'function');
988 };
989 /**
990 * Checks whether the given object is a DOM node.
991 *
992 * @param value object to check whether it's a DOM node
993 * @return true is object is a DOM node
994 */
995 const _isNode = function _isNode(value) {
996 return typeof Node === 'function' && value instanceof Node;
997 };
998 function _executeHooks(hooks, currentNode, data) {
999 arrayForEach(hooks, hook => {
1000 hook.call(DOMPurify, currentNode, data, CONFIG);
1001 });
1002 }
1003 /**
1004 * _sanitizeElements
1005 *
1006 * @protect nodeName
1007 * @protect textContent
1008 * @protect removeChild
1009 * @param currentNode to check for permission to exist
1010 * @return true if node was killed, false if left alive
1011 */
1012 const _sanitizeElements = function _sanitizeElements(currentNode) {
1013 let content = null;
1014 /* Execute a hook if present */
1015 _executeHooks(hooks.beforeSanitizeElements, currentNode, null);
1016 /* Check if element is clobbered or can clobber */
1017 if (_isClobbered(currentNode)) {
1018 _forceRemove(currentNode);
1019 return true;
1020 }
1021 /* Now let's check the element's type and name */
1022 const tagName = transformCaseFunc(currentNode.nodeName);
1023 /* Execute a hook if present */
1024 _executeHooks(hooks.uponSanitizeElement, currentNode, {
1025 tagName,
1026 allowedTags: ALLOWED_TAGS
1027 });
1028 /* Detect mXSS attempts abusing namespace confusion */
1029 if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w]/g, currentNode.innerHTML) && regExpTest(/<[/\w]/g, currentNode.textContent)) {
1030 _forceRemove(currentNode);
1031 return true;
1032 }
1033 /* Remove any occurrence of processing instructions */
1034 if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {
1035 _forceRemove(currentNode);
1036 return true;
1037 }
1038 /* Remove any kind of possibly harmful comments */
1039 if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) {
1040 _forceRemove(currentNode);
1041 return true;
1042 }
1043 /* Remove element if anything forbids its presence */
1044 if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
1045 /* Check if we have a custom element to handle */
1046 if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
1047 if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {
1048 return false;
1049 }
1050 if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {
1051 return false;
1052 }
1053 }
1054 /* Keep content except for bad-listed elements */
1055 if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
1056 const parentNode = getParentNode(currentNode) || currentNode.parentNode;
1057 const childNodes = getChildNodes(currentNode) || currentNode.childNodes;
1058 if (childNodes && parentNode) {
1059 const childCount = childNodes.length;
1060 for (let i = childCount - 1; i >= 0; --i) {
1061 const childClone = cloneNode(childNodes[i], true);
1062 childClone.__removalCount = (currentNode.__removalCount || 0) + 1;
1063 parentNode.insertBefore(childClone, getNextSibling(currentNode));
1064 }
1065 }
1066 }
1067 _forceRemove(currentNode);
1068 return true;
1069 }
1070 /* Check whether element has a valid namespace */
1071 if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {
1072 _forceRemove(currentNode);
1073 return true;
1074 }
1075 /* Make sure that older browsers don't get fallback-tag mXSS */
1076 if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\/no(script|embed|frames)/i, currentNode.innerHTML)) {
1077 _forceRemove(currentNode);
1078 return true;
1079 }
1080 /* Sanitize element content to be template-safe */
1081 if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
1082 /* Get the element's text content */
1083 content = currentNode.textContent;
1084 arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
1085 content = stringReplace(content, expr, ' ');
1086 });
1087 if (currentNode.textContent !== content) {
1088 arrayPush(DOMPurify.removed, {
1089 element: currentNode.cloneNode()
1090 });
1091 currentNode.textContent = content;
1092 }
1093 }
1094 /* Execute a hook if present */
1095 _executeHooks(hooks.afterSanitizeElements, currentNode, null);
1096 return false;
1097 };
1098 /**
1099 * _isValidAttribute
1100 *
1101 * @param lcTag Lowercase tag name of containing element.
1102 * @param lcName Lowercase attribute name.
1103 * @param value Attribute value.
1104 * @return Returns true if `value` is valid, otherwise false.
1105 */
1106 // eslint-disable-next-line complexity
1107 const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {
1108 /* Make sure attribute cannot clobber */
1109 if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {
1110 return false;
1111 }
1112 /* Allow valid data-* attributes: At least one character after "-"
1113 (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)
1114 XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)
1115 We don't need to check the value; it's always URI safe. */
1116 if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
1117 if (
1118 // First condition does a very basic check if a) it's basically a valid custom element tagname AND
1119 // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
1120 // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
1121 _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) ||
1122 // Alternative, second condition checks if it's an `is`-attribute, AND
1123 // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
1124 lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else {
1125 return false;
1126 }
1127 /* Check value is safe. First, is attr inert? If so, is safe */
1128 } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (value) {
1129 return false;
1130 } else ;
1131 return true;
1132 };
1133 /**
1134 * _isBasicCustomElement
1135 * checks if at least one dash is included in tagName, and it's not the first char
1136 * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name
1137 *
1138 * @param tagName name of the tag of the node to sanitize
1139 * @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.
1140 */
1141 const _isBasicCustomElement = function _isBasicCustomElement(tagName) {
1142 return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT);
1143 };
1144 /**
1145 * _sanitizeAttributes
1146 *
1147 * @protect attributes
1148 * @protect nodeName
1149 * @protect removeAttribute
1150 * @protect setAttribute
1151 *
1152 * @param currentNode to sanitize
1153 */
1154 const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {
1155 /* Execute a hook if present */
1156 _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
1157 const {
1158 attributes
1159 } = currentNode;
1160 /* Check if we have attributes; if not we might have a text node */
1161 if (!attributes || _isClobbered(currentNode)) {
1162 return;
1163 }
1164 const hookEvent = {
1165 attrName: '',
1166 attrValue: '',
1167 keepAttr: true,
1168 allowedAttributes: ALLOWED_ATTR,
1169 forceKeepAttr: undefined
1170 };
1171 let l = attributes.length;
1172 /* Go backwards over all attributes; safely remove bad ones */
1173 while (l--) {
1174 const attr = attributes[l];
1175 const {
1176 name,
1177 namespaceURI,
1178 value: attrValue
1179 } = attr;
1180 const lcName = transformCaseFunc(name);
1181 let value = name === 'value' ? attrValue : stringTrim(attrValue);
1182 /* Execute a hook if present */
1183 hookEvent.attrName = lcName;
1184 hookEvent.attrValue = value;
1185 hookEvent.keepAttr = true;
1186 hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set
1187 _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);
1188 value = hookEvent.attrValue;
1189 /* Full DOM Clobbering protection via namespace isolation,
1190 * Prefix id and name attributes with `user-content-`
1191 */
1192 if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {
1193 // Remove the attribute with this value
1194 _removeAttribute(name, currentNode);
1195 // Prefix the value and later re-create the attribute with the sanitized value
1196 value = SANITIZE_NAMED_PROPS_PREFIX + value;
1197 }
1198 /* Work around a security issue with comments inside attributes */
1199 if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title)/i, value)) {
1200 _removeAttribute(name, currentNode);
1201 continue;
1202 }
1203 /* Did the hooks approve of the attribute? */
1204 if (hookEvent.forceKeepAttr) {
1205 continue;
1206 }
1207 /* Remove attribute */
1208 _removeAttribute(name, currentNode);
1209 /* Did the hooks approve of the attribute? */
1210 if (!hookEvent.keepAttr) {
1211 continue;
1212 }
1213 /* Work around a security issue in jQuery 3.0 */
1214 if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) {
1215 _removeAttribute(name, currentNode);
1216 continue;
1217 }
1218 /* Sanitize attribute content to be template-safe */
1219 if (SAFE_FOR_TEMPLATES) {
1220 arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
1221 value = stringReplace(value, expr, ' ');
1222 });
1223 }
1224 /* Is `value` valid for this attribute? */
1225 const lcTag = transformCaseFunc(currentNode.nodeName);
1226 if (!_isValidAttribute(lcTag, lcName, value)) {
1227 continue;
1228 }
1229 /* Handle attributes that require Trusted Types */
1230 if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {
1231 if (namespaceURI) ; else {
1232 switch (trustedTypes.getAttributeType(lcTag, lcName)) {
1233 case 'TrustedHTML':
1234 {
1235 value = trustedTypesPolicy.createHTML(value);
1236 break;
1237 }
1238 case 'TrustedScriptURL':
1239 {
1240 value = trustedTypesPolicy.createScriptURL(value);
1241 break;
1242 }
1243 }
1244 }
1245 }
1246 /* Handle invalid data-* attribute set by try-catching it */
1247 try {
1248 if (namespaceURI) {
1249 currentNode.setAttributeNS(namespaceURI, name, value);
1250 } else {
1251 /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */
1252 currentNode.setAttribute(name, value);
1253 }
1254 if (_isClobbered(currentNode)) {
1255 _forceRemove(currentNode);
1256 } else {
1257 arrayPop(DOMPurify.removed);
1258 }
1259 } catch (_) {}
1260 }
1261 /* Execute a hook if present */
1262 _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
1263 };
1264 /**
1265 * _sanitizeShadowDOM
1266 *
1267 * @param fragment to iterate over recursively
1268 */
1269 const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {
1270 let shadowNode = null;
1271 const shadowIterator = _createNodeIterator(fragment);
1272 /* Execute a hook if present */
1273 _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);
1274 while (shadowNode = shadowIterator.nextNode()) {
1275 /* Execute a hook if present */
1276 _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);
1277 /* Sanitize tags and elements */
1278 _sanitizeElements(shadowNode);
1279 /* Check attributes next */
1280 _sanitizeAttributes(shadowNode);
1281 /* Deep shadow DOM detected */
1282 if (shadowNode.content instanceof DocumentFragment) {
1283 _sanitizeShadowDOM(shadowNode.content);
1284 }
1285 }
1286 /* Execute a hook if present */
1287 _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
1288 };
1289 // eslint-disable-next-line complexity
1290 DOMPurify.sanitize = function (dirty) {
1291 let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1292 let body = null;
1293 let importedNode = null;
1294 let currentNode = null;
1295 let returnNode = null;
1296 /* Make sure we have a string to sanitize.
1297 DO NOT return early, as this will return the wrong type if
1298 the user has requested a DOM object rather than a string */
1299 IS_EMPTY_INPUT = !dirty;
1300 if (IS_EMPTY_INPUT) {
1301 dirty = '<!-->';
1302 }
1303 /* Stringify, in case dirty is an object */
1304 if (typeof dirty !== 'string' && !_isNode(dirty)) {
1305 if (typeof dirty.toString === 'function') {
1306 dirty = dirty.toString();
1307 if (typeof dirty !== 'string') {
1308 throw typeErrorCreate('dirty is not a string, aborting');
1309 }
1310 } else {
1311 throw typeErrorCreate('toString is not a function');
1312 }
1313 }
1314 /* Return dirty HTML if DOMPurify cannot run */
1315 if (!DOMPurify.isSupported) {
1316 return dirty;
1317 }
1318 /* Assign config vars */
1319 if (!SET_CONFIG) {
1320 _parseConfig(cfg);
1321 }
1322 /* Clean up removed elements */
1323 DOMPurify.removed = [];
1324 /* Check if dirty is correctly typed for IN_PLACE */
1325 if (typeof dirty === 'string') {
1326 IN_PLACE = false;
1327 }
1328 if (IN_PLACE) {
1329 /* Do some early pre-sanitization to avoid unsafe root nodes */
1330 if (dirty.nodeName) {
1331 const tagName = transformCaseFunc(dirty.nodeName);
1332 if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
1333 throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');
1334 }
1335 }
1336 } else if (dirty instanceof Node) {
1337 /* If dirty is a DOM element, append to an empty document to avoid
1338 elements being stripped by the parser */
1339 body = _initDocument('<!---->');
1340 importedNode = body.ownerDocument.importNode(dirty, true);
1341 if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === 'BODY') {
1342 /* Node is already a body, use as is */
1343 body = importedNode;
1344 } else if (importedNode.nodeName === 'HTML') {
1345 body = importedNode;
1346 } else {
1347 // eslint-disable-next-line unicorn/prefer-dom-node-append
1348 body.appendChild(importedNode);
1349 }
1350 } else {
1351 /* Exit directly if we have nothing to do */
1352 if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&
1353 // eslint-disable-next-line unicorn/prefer-includes
1354 dirty.indexOf('<') === -1) {
1355 return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;
1356 }
1357 /* Initialize the document to work on */
1358 body = _initDocument(dirty);
1359 /* Check we have a DOM node from the data */
1360 if (!body) {
1361 return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';
1362 }
1363 }
1364 /* Remove first element node (ours) if FORCE_BODY is set */
1365 if (body && FORCE_BODY) {
1366 _forceRemove(body.firstChild);
1367 }
1368 /* Get node iterator */
1369 const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);
1370 /* Now start iterating over the created document */
1371 while (currentNode = nodeIterator.nextNode()) {
1372 /* Sanitize tags and elements */
1373 _sanitizeElements(currentNode);
1374 /* Check attributes next */
1375 _sanitizeAttributes(currentNode);
1376 /* Shadow DOM detected, sanitize it */
1377 if (currentNode.content instanceof DocumentFragment) {
1378 _sanitizeShadowDOM(currentNode.content);
1379 }
1380 }
1381 /* If we sanitized `dirty` in-place, return it. */
1382 if (IN_PLACE) {
1383 return dirty;
1384 }
1385 /* Return sanitized string or DOM */
1386 if (RETURN_DOM) {
1387 if (RETURN_DOM_FRAGMENT) {
1388 returnNode = createDocumentFragment.call(body.ownerDocument);
1389 while (body.firstChild) {
1390 // eslint-disable-next-line unicorn/prefer-dom-node-append
1391 returnNode.appendChild(body.firstChild);
1392 }
1393 } else {
1394 returnNode = body;
1395 }
1396 if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {
1397 /*
1398 AdoptNode() is not used because internal state is not reset
1399 (e.g. the past names map of a HTMLFormElement), this is safe
1400 in theory but we would rather not risk another attack vector.
1401 The state that is cloned by importNode() is explicitly defined
1402 by the specs.
1403 */
1404 returnNode = importNode.call(originalDocument, returnNode, true);
1405 }
1406 return returnNode;
1407 }
1408 let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
1409 /* Serialize doctype if allowed */
1410 if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {
1411 serializedHTML = '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\n' + serializedHTML;
1412 }
1413 /* Sanitize final string template-safe */
1414 if (SAFE_FOR_TEMPLATES) {
1415 arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
1416 serializedHTML = stringReplace(serializedHTML, expr, ' ');
1417 });
1418 }
1419 return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
1420 };
1421 DOMPurify.setConfig = function () {
1422 let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1423 _parseConfig(cfg);
1424 SET_CONFIG = true;
1425 };
1426 DOMPurify.clearConfig = function () {
1427 CONFIG = null;
1428 SET_CONFIG = false;
1429 };
1430 DOMPurify.isValidAttribute = function (tag, attr, value) {
1431 /* Initialize shared config vars if necessary. */
1432 if (!CONFIG) {
1433 _parseConfig({});
1434 }
1435 const lcTag = transformCaseFunc(tag);
1436 const lcName = transformCaseFunc(attr);
1437 return _isValidAttribute(lcTag, lcName, value);
1438 };
1439 DOMPurify.addHook = function (entryPoint, hookFunction) {
1440 if (typeof hookFunction !== 'function') {
1441 return;
1442 }
1443 arrayPush(hooks[entryPoint], hookFunction);
1444 };
1445 DOMPurify.removeHook = function (entryPoint, hookFunction) {
1446 if (hookFunction !== undefined) {
1447 const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);
1448 return index === -1 ? undefined : arraySplice(hooks[entryPoint], index, 1)[0];
1449 }
1450 return arrayPop(hooks[entryPoint]);
1451 };
1452 DOMPurify.removeHooks = function (entryPoint) {
1453 hooks[entryPoint] = [];
1454 };
1455 DOMPurify.removeAllHooks = function () {
1456 hooks = _createHooksMap();
1457 };
1458 return DOMPurify;
1459 }
1460 var purify = createDOMPurify();
1461
1462
1463 //# sourceMappingURL=purify.es.mjs.map
1464
1465
1466 /***/ }),
1467
1468 /***/ 54758:
1469 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1470
1471 "use strict";
1472
1473 // EXPORTS
1474 __webpack_require__.d(__webpack_exports__, {
1475 Z: () => (/* binding */ reusable)
1476 });
1477
1478 // EXTERNAL MODULE: ../node_modules/khroma/dist/utils/index.js + 3 modules
1479 var utils = __webpack_require__(90267);
1480 // EXTERNAL MODULE: ../node_modules/khroma/dist/constants.js
1481 var constants = __webpack_require__(62187);
1482 ;// CONCATENATED MODULE: ../node_modules/khroma/dist/channels/type.js
1483 /* IMPORT */
1484
1485 /* MAIN */
1486 class Type {
1487 constructor() {
1488 /* VARIABLES */
1489 this.type = constants/* TYPE */.w.ALL;
1490 }
1491 /* API */
1492 get() {
1493 return this.type;
1494 }
1495 set(type) {
1496 if (this.type && this.type !== type)
1497 throw new Error('Cannot change both RGB and HSL channels at the same time');
1498 this.type = type;
1499 }
1500 reset() {
1501 this.type = constants/* TYPE */.w.ALL;
1502 }
1503 is(type) {
1504 return this.type === type;
1505 }
1506 }
1507 /* EXPORT */
1508 /* harmony default export */ const type = (Type);
1509
1510 ;// CONCATENATED MODULE: ../node_modules/khroma/dist/channels/index.js
1511 /* IMPORT */
1512
1513
1514
1515 /* MAIN */
1516 class Channels {
1517 /* CONSTRUCTOR */
1518 constructor(data, color) {
1519 this.color = color;
1520 this.changed = false;
1521 this.data = data; //TSC
1522 this.type = new type();
1523 }
1524 /* API */
1525 set(data, color) {
1526 this.color = color;
1527 this.changed = false;
1528 this.data = data; //TSC
1529 this.type.type = constants/* TYPE */.w.ALL;
1530 return this;
1531 }
1532 /* HELPERS */
1533 _ensureHSL() {
1534 const data = this.data;
1535 const { h, s, l } = data;
1536 if (h === undefined)
1537 data.h = utils/* default */.Z.channel.rgb2hsl(data, 'h');
1538 if (s === undefined)
1539 data.s = utils/* default */.Z.channel.rgb2hsl(data, 's');
1540 if (l === undefined)
1541 data.l = utils/* default */.Z.channel.rgb2hsl(data, 'l');
1542 }
1543 _ensureRGB() {
1544 const data = this.data;
1545 const { r, g, b } = data;
1546 if (r === undefined)
1547 data.r = utils/* default */.Z.channel.hsl2rgb(data, 'r');
1548 if (g === undefined)
1549 data.g = utils/* default */.Z.channel.hsl2rgb(data, 'g');
1550 if (b === undefined)
1551 data.b = utils/* default */.Z.channel.hsl2rgb(data, 'b');
1552 }
1553 /* GETTERS */
1554 get r() {
1555 const data = this.data;
1556 const r = data.r;
1557 if (!this.type.is(constants/* TYPE */.w.HSL) && r !== undefined)
1558 return r;
1559 this._ensureHSL();
1560 return utils/* default */.Z.channel.hsl2rgb(data, 'r');
1561 }
1562 get g() {
1563 const data = this.data;
1564 const g = data.g;
1565 if (!this.type.is(constants/* TYPE */.w.HSL) && g !== undefined)
1566 return g;
1567 this._ensureHSL();
1568 return utils/* default */.Z.channel.hsl2rgb(data, 'g');
1569 }
1570 get b() {
1571 const data = this.data;
1572 const b = data.b;
1573 if (!this.type.is(constants/* TYPE */.w.HSL) && b !== undefined)
1574 return b;
1575 this._ensureHSL();
1576 return utils/* default */.Z.channel.hsl2rgb(data, 'b');
1577 }
1578 get h() {
1579 const data = this.data;
1580 const h = data.h;
1581 if (!this.type.is(constants/* TYPE */.w.RGB) && h !== undefined)
1582 return h;
1583 this._ensureRGB();
1584 return utils/* default */.Z.channel.rgb2hsl(data, 'h');
1585 }
1586 get s() {
1587 const data = this.data;
1588 const s = data.s;
1589 if (!this.type.is(constants/* TYPE */.w.RGB) && s !== undefined)
1590 return s;
1591 this._ensureRGB();
1592 return utils/* default */.Z.channel.rgb2hsl(data, 's');
1593 }
1594 get l() {
1595 const data = this.data;
1596 const l = data.l;
1597 if (!this.type.is(constants/* TYPE */.w.RGB) && l !== undefined)
1598 return l;
1599 this._ensureRGB();
1600 return utils/* default */.Z.channel.rgb2hsl(data, 'l');
1601 }
1602 get a() {
1603 return this.data.a;
1604 }
1605 /* SETTERS */
1606 set r(r) {
1607 this.type.set(constants/* TYPE */.w.RGB);
1608 this.changed = true;
1609 this.data.r = r;
1610 }
1611 set g(g) {
1612 this.type.set(constants/* TYPE */.w.RGB);
1613 this.changed = true;
1614 this.data.g = g;
1615 }
1616 set b(b) {
1617 this.type.set(constants/* TYPE */.w.RGB);
1618 this.changed = true;
1619 this.data.b = b;
1620 }
1621 set h(h) {
1622 this.type.set(constants/* TYPE */.w.HSL);
1623 this.changed = true;
1624 this.data.h = h;
1625 }
1626 set s(s) {
1627 this.type.set(constants/* TYPE */.w.HSL);
1628 this.changed = true;
1629 this.data.s = s;
1630 }
1631 set l(l) {
1632 this.type.set(constants/* TYPE */.w.HSL);
1633 this.changed = true;
1634 this.data.l = l;
1635 }
1636 set a(a) {
1637 this.changed = true;
1638 this.data.a = a;
1639 }
1640 }
1641 /* EXPORT */
1642 /* harmony default export */ const channels = (Channels);
1643
1644 ;// CONCATENATED MODULE: ../node_modules/khroma/dist/channels/reusable.js
1645 /* IMPORT */
1646
1647 /* MAIN */
1648 const reusable_channels = new channels({ r: 0, g: 0, b: 0, a: 0 }, 'transparent');
1649 /* EXPORT */
1650 /* harmony default export */ const reusable = (reusable_channels);
1651
1652
1653 /***/ }),
1654
1655 /***/ 42528:
1656 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1657
1658 "use strict";
1659
1660 // EXPORTS
1661 __webpack_require__.d(__webpack_exports__, {
1662 Z: () => (/* binding */ color)
1663 });
1664
1665 // EXTERNAL MODULE: ../node_modules/khroma/dist/channels/reusable.js + 2 modules
1666 var reusable = __webpack_require__(54758);
1667 // EXTERNAL MODULE: ../node_modules/khroma/dist/constants.js
1668 var constants = __webpack_require__(62187);
1669 ;// CONCATENATED MODULE: ../node_modules/khroma/dist/color/hex.js
1670 /* IMPORT */
1671
1672
1673
1674 /* MAIN */
1675 const Hex = {
1676 /* VARIABLES */
1677 re: /^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,
1678 /* API */
1679 parse: (color) => {
1680 if (color.charCodeAt(0) !== 35)
1681 return; // '#'
1682 const match = color.match(Hex.re);
1683 if (!match)
1684 return;
1685 const hex = match[1];
1686 const dec = parseInt(hex, 16);
1687 const length = hex.length;
1688 const hasAlpha = length % 4 === 0;
1689 const isFullLength = length > 4;
1690 const multiplier = isFullLength ? 1 : 17;
1691 const bits = isFullLength ? 8 : 4;
1692 const bitsOffset = hasAlpha ? 0 : -1;
1693 const mask = isFullLength ? 255 : 15;
1694 return reusable/* default */.Z.set({
1695 r: ((dec >> (bits * (bitsOffset + 3))) & mask) * multiplier,
1696 g: ((dec >> (bits * (bitsOffset + 2))) & mask) * multiplier,
1697 b: ((dec >> (bits * (bitsOffset + 1))) & mask) * multiplier,
1698 a: hasAlpha ? (dec & mask) * multiplier / 255 : 1
1699 }, color);
1700 },
1701 stringify: (channels) => {
1702 const { r, g, b, a } = channels;
1703 if (a < 1) { // #RRGGBBAA
1704 return `#${constants/* DEC2HEX */.Q[Math.round(r)]}${constants/* DEC2HEX */.Q[Math.round(g)]}${constants/* DEC2HEX */.Q[Math.round(b)]}${constants/* DEC2HEX */.Q[Math.round(a * 255)]}`;
1705 }
1706 else { // #RRGGBB
1707 return `#${constants/* DEC2HEX */.Q[Math.round(r)]}${constants/* DEC2HEX */.Q[Math.round(g)]}${constants/* DEC2HEX */.Q[Math.round(b)]}`;
1708 }
1709 }
1710 };
1711 /* EXPORT */
1712 /* harmony default export */ const color_hex = (Hex);
1713
1714 // EXTERNAL MODULE: ../node_modules/khroma/dist/utils/index.js + 3 modules
1715 var utils = __webpack_require__(90267);
1716 ;// CONCATENATED MODULE: ../node_modules/khroma/dist/color/hsl.js
1717 /* IMPORT */
1718
1719
1720 /* MAIN */
1721 const HSL = {
1722 /* VARIABLES */
1723 re: /^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,
1724 hueRe: /^(.+?)(deg|grad|rad|turn)$/i,
1725 /* HELPERS */
1726 _hue2deg: (hue) => {
1727 const match = hue.match(HSL.hueRe);
1728 if (match) {
1729 const [, number, unit] = match;
1730 switch (unit) {
1731 case 'grad': return utils/* default */.Z.channel.clamp.h(parseFloat(number) * .9);
1732 case 'rad': return utils/* default */.Z.channel.clamp.h(parseFloat(number) * 180 / Math.PI);
1733 case 'turn': return utils/* default */.Z.channel.clamp.h(parseFloat(number) * 360);
1734 }
1735 }
1736 return utils/* default */.Z.channel.clamp.h(parseFloat(hue));
1737 },
1738 /* API */
1739 parse: (color) => {
1740 const charCode = color.charCodeAt(0);
1741 if (charCode !== 104 && charCode !== 72)
1742 return; // 'h'/'H'
1743 const match = color.match(HSL.re);
1744 if (!match)
1745 return;
1746 const [, h, s, l, a, isAlphaPercentage] = match;
1747 return reusable/* default */.Z.set({
1748 h: HSL._hue2deg(h),
1749 s: utils/* default */.Z.channel.clamp.s(parseFloat(s)),
1750 l: utils/* default */.Z.channel.clamp.l(parseFloat(l)),
1751 a: a ? utils/* default */.Z.channel.clamp.a(isAlphaPercentage ? parseFloat(a) / 100 : parseFloat(a)) : 1
1752 }, color);
1753 },
1754 stringify: (channels) => {
1755 const { h, s, l, a } = channels;
1756 if (a < 1) { // HSLA
1757 return `hsla(${utils/* default */.Z.lang.round(h)}, ${utils/* default */.Z.lang.round(s)}%, ${utils/* default */.Z.lang.round(l)}%, ${a})`;
1758 }
1759 else { // HSL
1760 return `hsl(${utils/* default */.Z.lang.round(h)}, ${utils/* default */.Z.lang.round(s)}%, ${utils/* default */.Z.lang.round(l)}%)`;
1761 }
1762 }
1763 };
1764 /* EXPORT */
1765 /* harmony default export */ const hsl = (HSL);
1766
1767 ;// CONCATENATED MODULE: ../node_modules/khroma/dist/color/keyword.js
1768 /* IMPORT */
1769
1770 /* MAIN */
1771 const Keyword = {
1772 /* VARIABLES */
1773 colors: {
1774 aliceblue: '#f0f8ff',
1775 antiquewhite: '#faebd7',
1776 aqua: '#00ffff',
1777 aquamarine: '#7fffd4',
1778 azure: '#f0ffff',
1779 beige: '#f5f5dc',
1780 bisque: '#ffe4c4',
1781 black: '#000000',
1782 blanchedalmond: '#ffebcd',
1783 blue: '#0000ff',
1784 blueviolet: '#8a2be2',
1785 brown: '#a52a2a',
1786 burlywood: '#deb887',
1787 cadetblue: '#5f9ea0',
1788 chartreuse: '#7fff00',
1789 chocolate: '#d2691e',
1790 coral: '#ff7f50',
1791 cornflowerblue: '#6495ed',
1792 cornsilk: '#fff8dc',
1793 crimson: '#dc143c',
1794 cyanaqua: '#00ffff',
1795 darkblue: '#00008b',
1796 darkcyan: '#008b8b',
1797 darkgoldenrod: '#b8860b',
1798 darkgray: '#a9a9a9',
1799 darkgreen: '#006400',
1800 darkgrey: '#a9a9a9',
1801 darkkhaki: '#bdb76b',
1802 darkmagenta: '#8b008b',
1803 darkolivegreen: '#556b2f',
1804 darkorange: '#ff8c00',
1805 darkorchid: '#9932cc',
1806 darkred: '#8b0000',
1807 darksalmon: '#e9967a',
1808 darkseagreen: '#8fbc8f',
1809 darkslateblue: '#483d8b',
1810 darkslategray: '#2f4f4f',
1811 darkslategrey: '#2f4f4f',
1812 darkturquoise: '#00ced1',
1813 darkviolet: '#9400d3',
1814 deeppink: '#ff1493',
1815 deepskyblue: '#00bfff',
1816 dimgray: '#696969',
1817 dimgrey: '#696969',
1818 dodgerblue: '#1e90ff',
1819 firebrick: '#b22222',
1820 floralwhite: '#fffaf0',
1821 forestgreen: '#228b22',
1822 fuchsia: '#ff00ff',
1823 gainsboro: '#dcdcdc',
1824 ghostwhite: '#f8f8ff',
1825 gold: '#ffd700',
1826 goldenrod: '#daa520',
1827 gray: '#808080',
1828 green: '#008000',
1829 greenyellow: '#adff2f',
1830 grey: '#808080',
1831 honeydew: '#f0fff0',
1832 hotpink: '#ff69b4',
1833 indianred: '#cd5c5c',
1834 indigo: '#4b0082',
1835 ivory: '#fffff0',
1836 khaki: '#f0e68c',
1837 lavender: '#e6e6fa',
1838 lavenderblush: '#fff0f5',
1839 lawngreen: '#7cfc00',
1840 lemonchiffon: '#fffacd',
1841 lightblue: '#add8e6',
1842 lightcoral: '#f08080',
1843 lightcyan: '#e0ffff',
1844 lightgoldenrodyellow: '#fafad2',
1845 lightgray: '#d3d3d3',
1846 lightgreen: '#90ee90',
1847 lightgrey: '#d3d3d3',
1848 lightpink: '#ffb6c1',
1849 lightsalmon: '#ffa07a',
1850 lightseagreen: '#20b2aa',
1851 lightskyblue: '#87cefa',
1852 lightslategray: '#778899',
1853 lightslategrey: '#778899',
1854 lightsteelblue: '#b0c4de',
1855 lightyellow: '#ffffe0',
1856 lime: '#00ff00',
1857 limegreen: '#32cd32',
1858 linen: '#faf0e6',
1859 magenta: '#ff00ff',
1860 maroon: '#800000',
1861 mediumaquamarine: '#66cdaa',
1862 mediumblue: '#0000cd',
1863 mediumorchid: '#ba55d3',
1864 mediumpurple: '#9370db',
1865 mediumseagreen: '#3cb371',
1866 mediumslateblue: '#7b68ee',
1867 mediumspringgreen: '#00fa9a',
1868 mediumturquoise: '#48d1cc',
1869 mediumvioletred: '#c71585',
1870 midnightblue: '#191970',
1871 mintcream: '#f5fffa',
1872 mistyrose: '#ffe4e1',
1873 moccasin: '#ffe4b5',
1874 navajowhite: '#ffdead',
1875 navy: '#000080',
1876 oldlace: '#fdf5e6',
1877 olive: '#808000',
1878 olivedrab: '#6b8e23',
1879 orange: '#ffa500',
1880 orangered: '#ff4500',
1881 orchid: '#da70d6',
1882 palegoldenrod: '#eee8aa',
1883 palegreen: '#98fb98',
1884 paleturquoise: '#afeeee',
1885 palevioletred: '#db7093',
1886 papayawhip: '#ffefd5',
1887 peachpuff: '#ffdab9',
1888 peru: '#cd853f',
1889 pink: '#ffc0cb',
1890 plum: '#dda0dd',
1891 powderblue: '#b0e0e6',
1892 purple: '#800080',
1893 rebeccapurple: '#663399',
1894 red: '#ff0000',
1895 rosybrown: '#bc8f8f',
1896 royalblue: '#4169e1',
1897 saddlebrown: '#8b4513',
1898 salmon: '#fa8072',
1899 sandybrown: '#f4a460',
1900 seagreen: '#2e8b57',
1901 seashell: '#fff5ee',
1902 sienna: '#a0522d',
1903 silver: '#c0c0c0',
1904 skyblue: '#87ceeb',
1905 slateblue: '#6a5acd',
1906 slategray: '#708090',
1907 slategrey: '#708090',
1908 snow: '#fffafa',
1909 springgreen: '#00ff7f',
1910 tan: '#d2b48c',
1911 teal: '#008080',
1912 thistle: '#d8bfd8',
1913 transparent: '#00000000',
1914 turquoise: '#40e0d0',
1915 violet: '#ee82ee',
1916 wheat: '#f5deb3',
1917 white: '#ffffff',
1918 whitesmoke: '#f5f5f5',
1919 yellow: '#ffff00',
1920 yellowgreen: '#9acd32'
1921 },
1922 /* API */
1923 parse: (color) => {
1924 color = color.toLowerCase();
1925 const hex = Keyword.colors[color];
1926 if (!hex)
1927 return;
1928 return color_hex.parse(hex);
1929 },
1930 stringify: (channels) => {
1931 const hex = color_hex.stringify(channels);
1932 for (const name in Keyword.colors) {
1933 if (Keyword.colors[name] === hex)
1934 return name;
1935 }
1936 return;
1937 }
1938 };
1939 /* EXPORT */
1940 /* harmony default export */ const keyword = (Keyword);
1941
1942 ;// CONCATENATED MODULE: ../node_modules/khroma/dist/color/rgb.js
1943 /* IMPORT */
1944
1945
1946 /* MAIN */
1947 const RGB = {
1948 /* VARIABLES */
1949 re: /^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,
1950 /* API */
1951 parse: (color) => {
1952 const charCode = color.charCodeAt(0);
1953 if (charCode !== 114 && charCode !== 82)
1954 return; // 'r'/'R'
1955 const match = color.match(RGB.re);
1956 if (!match)
1957 return;
1958 const [, r, isRedPercentage, g, isGreenPercentage, b, isBluePercentage, a, isAlphaPercentage] = match;
1959 return reusable/* default */.Z.set({
1960 r: utils/* default */.Z.channel.clamp.r(isRedPercentage ? parseFloat(r) * 2.55 : parseFloat(r)),
1961 g: utils/* default */.Z.channel.clamp.g(isGreenPercentage ? parseFloat(g) * 2.55 : parseFloat(g)),
1962 b: utils/* default */.Z.channel.clamp.b(isBluePercentage ? parseFloat(b) * 2.55 : parseFloat(b)),
1963 a: a ? utils/* default */.Z.channel.clamp.a(isAlphaPercentage ? parseFloat(a) / 100 : parseFloat(a)) : 1
1964 }, color);
1965 },
1966 stringify: (channels) => {
1967 const { r, g, b, a } = channels;
1968 if (a < 1) { // RGBA
1969 return `rgba(${utils/* default */.Z.lang.round(r)}, ${utils/* default */.Z.lang.round(g)}, ${utils/* default */.Z.lang.round(b)}, ${utils/* default */.Z.lang.round(a)})`;
1970 }
1971 else { // RGB
1972 return `rgb(${utils/* default */.Z.lang.round(r)}, ${utils/* default */.Z.lang.round(g)}, ${utils/* default */.Z.lang.round(b)})`;
1973 }
1974 }
1975 };
1976 /* EXPORT */
1977 /* harmony default export */ const rgb = (RGB);
1978
1979 ;// CONCATENATED MODULE: ../node_modules/khroma/dist/color/index.js
1980 /* IMPORT */
1981
1982
1983
1984
1985
1986
1987 /* MAIN */
1988 const Color = {
1989 /* VARIABLES */
1990 format: {
1991 keyword: keyword,
1992 hex: color_hex,
1993 rgb: rgb,
1994 rgba: rgb,
1995 hsl: hsl,
1996 hsla: hsl
1997 },
1998 /* API */
1999 parse: (color) => {
2000 if (typeof color !== 'string')
2001 return color;
2002 const channels = color_hex.parse(color) || rgb.parse(color) || hsl.parse(color) || keyword.parse(color); // Color providers ordered with performance in mind
2003 if (channels)
2004 return channels;
2005 throw new Error(`Unsupported color format: "${color}"`);
2006 },
2007 stringify: (channels) => {
2008 // SASS returns a keyword if possible, but we avoid doing that as it's slower and doesn't really add any value
2009 if (!channels.changed && channels.color)
2010 return channels.color;
2011 if (channels.type.is(constants/* TYPE */.w.HSL) || channels.data.r === undefined) {
2012 return hsl.stringify(channels);
2013 }
2014 else if (channels.a < 1 || !Number.isInteger(channels.r) || !Number.isInteger(channels.g) || !Number.isInteger(channels.b)) {
2015 return rgb.stringify(channels);
2016 }
2017 else {
2018 return color_hex.stringify(channels);
2019 }
2020 }
2021 };
2022 /* EXPORT */
2023 /* harmony default export */ const color = (Color);
2024
2025
2026 /***/ }),
2027
2028 /***/ 62187:
2029 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2030
2031 "use strict";
2032 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2033 /* harmony export */ Q: () => (/* binding */ DEC2HEX),
2034 /* harmony export */ w: () => (/* binding */ TYPE)
2035 /* harmony export */ });
2036 /* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(90267);
2037 /* IMPORT */
2038
2039 /* MAIN */
2040 const DEC2HEX = {};
2041 for (let i = 0; i <= 255; i++)
2042 DEC2HEX[i] = _utils_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.unit.dec2hex(i); // Populating dynamically, striking a balance between code size and performance
2043 const TYPE = {
2044 ALL: 0,
2045 RGB: 1,
2046 HSL: 2
2047 };
2048 /* EXPORT */
2049
2050
2051
2052 /***/ }),
2053
2054 /***/ 60680:
2055 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2056
2057 "use strict";
2058 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2059 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
2060 /* harmony export */ });
2061 /* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(90267);
2062 /* harmony import */ var _color_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(42528);
2063 /* IMPORT */
2064
2065
2066 /* MAIN */
2067 const adjustChannel = (color, channel, amount) => {
2068 const channels = _color_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.parse(color);
2069 const amountCurrent = channels[channel];
2070 const amountNext = _utils_index_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z.channel.clamp[channel](amountCurrent + amount);
2071 if (amountCurrent !== amountNext)
2072 channels[channel] = amountNext;
2073 return _color_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.stringify(channels);
2074 };
2075 /* EXPORT */
2076 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (adjustChannel);
2077
2078
2079 /***/ }),
2080
2081 /***/ 95323:
2082 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2083
2084 "use strict";
2085 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2086 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
2087 /* harmony export */ });
2088 /* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(90267);
2089 /* harmony import */ var _color_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(42528);
2090 /* IMPORT */
2091
2092
2093 /* MAIN */
2094 const change = (color, channels) => {
2095 const ch = _color_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.parse(color);
2096 for (const c in channels) {
2097 ch[c] = _utils_index_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z.channel.clamp[c](channels[c]);
2098 }
2099 return _color_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.stringify(ch);
2100 };
2101 /* EXPORT */
2102 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (change);
2103
2104
2105 /***/ }),
2106
2107 /***/ 57838:
2108 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2109
2110 "use strict";
2111 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2112 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
2113 /* harmony export */ });
2114 /* harmony import */ var _adjust_channel_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(60680);
2115 /* IMPORT */
2116
2117 /* MAIN */
2118 const darken = (color, amount) => {
2119 return (0,_adjust_channel_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(color, 'l', -amount);
2120 };
2121 /* EXPORT */
2122 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (darken);
2123
2124
2125 /***/ }),
2126
2127 /***/ 28186:
2128 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2129
2130 "use strict";
2131
2132 // EXPORTS
2133 __webpack_require__.d(__webpack_exports__, {
2134 Z: () => (/* binding */ is_dark)
2135 });
2136
2137 // EXTERNAL MODULE: ../node_modules/khroma/dist/utils/index.js + 3 modules
2138 var utils = __webpack_require__(90267);
2139 // EXTERNAL MODULE: ../node_modules/khroma/dist/color/index.js + 4 modules
2140 var dist_color = __webpack_require__(42528);
2141 ;// CONCATENATED MODULE: ../node_modules/khroma/dist/methods/luminance.js
2142 /* IMPORT */
2143
2144
2145 /* MAIN */
2146 //SOURCE: https://planetcalc.com/7779
2147 const luminance = (color) => {
2148 const { r, g, b } = dist_color/* default */.Z.parse(color);
2149 const luminance = .2126 * utils/* default */.Z.channel.toLinear(r) + .7152 * utils/* default */.Z.channel.toLinear(g) + .0722 * utils/* default */.Z.channel.toLinear(b);
2150 return utils/* default */.Z.lang.round(luminance);
2151 };
2152 /* EXPORT */
2153 /* harmony default export */ const methods_luminance = (luminance);
2154
2155 ;// CONCATENATED MODULE: ../node_modules/khroma/dist/methods/is_light.js
2156 /* IMPORT */
2157
2158 /* MAIN */
2159 const isLight = (color) => {
2160 return methods_luminance(color) >= .5;
2161 };
2162 /* EXPORT */
2163 /* harmony default export */ const is_light = (isLight);
2164
2165 ;// CONCATENATED MODULE: ../node_modules/khroma/dist/methods/is_dark.js
2166 /* IMPORT */
2167
2168 /* MAIN */
2169 const isDark = (color) => {
2170 return !is_light(color);
2171 };
2172 /* EXPORT */
2173 /* harmony default export */ const is_dark = (isDark);
2174
2175
2176 /***/ }),
2177
2178 /***/ 28482:
2179 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2180
2181 "use strict";
2182 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2183 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
2184 /* harmony export */ });
2185 /* harmony import */ var _adjust_channel_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(60680);
2186 /* IMPORT */
2187
2188 /* MAIN */
2189 const lighten = (color, amount) => {
2190 return (0,_adjust_channel_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(color, 'l', amount);
2191 };
2192 /* EXPORT */
2193 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (lighten);
2194
2195
2196 /***/ }),
2197
2198 /***/ 14728:
2199 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2200
2201 "use strict";
2202 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2203 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
2204 /* harmony export */ });
2205 /* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(90267);
2206 /* harmony import */ var _channels_reusable_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(54758);
2207 /* harmony import */ var _color_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(42528);
2208 /* harmony import */ var _change_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(95323);
2209 /* IMPORT */
2210
2211
2212
2213
2214 /* MAIN */
2215 const rgba = (r, g, b = 0, a = 1) => {
2216 if (typeof r !== 'number')
2217 return (0,_change_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(r, { a: g });
2218 const channels = _channels_reusable_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z.set({
2219 r: _utils_index_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.channel.clamp.r(r),
2220 g: _utils_index_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.channel.clamp.g(g),
2221 b: _utils_index_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.channel.clamp.b(b),
2222 a: _utils_index_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.channel.clamp.a(a)
2223 });
2224 return _color_index_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.stringify(channels);
2225 };
2226 /* EXPORT */
2227 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (rgba);
2228
2229
2230 /***/ }),
2231
2232 /***/ 90267:
2233 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2234
2235 "use strict";
2236
2237 // EXPORTS
2238 __webpack_require__.d(__webpack_exports__, {
2239 Z: () => (/* binding */ utils)
2240 });
2241
2242 ;// CONCATENATED MODULE: ../node_modules/khroma/dist/utils/channel.js
2243 /* IMPORT */
2244 /* MAIN */
2245 const Channel = {
2246 /* CLAMP */
2247 min: {
2248 r: 0,
2249 g: 0,
2250 b: 0,
2251 s: 0,
2252 l: 0,
2253 a: 0
2254 },
2255 max: {
2256 r: 255,
2257 g: 255,
2258 b: 255,
2259 h: 360,
2260 s: 100,
2261 l: 100,
2262 a: 1
2263 },
2264 clamp: {
2265 r: (r) => r >= 255 ? 255 : (r < 0 ? 0 : r),
2266 g: (g) => g >= 255 ? 255 : (g < 0 ? 0 : g),
2267 b: (b) => b >= 255 ? 255 : (b < 0 ? 0 : b),
2268 h: (h) => h % 360,
2269 s: (s) => s >= 100 ? 100 : (s < 0 ? 0 : s),
2270 l: (l) => l >= 100 ? 100 : (l < 0 ? 0 : l),
2271 a: (a) => a >= 1 ? 1 : (a < 0 ? 0 : a)
2272 },
2273 /* CONVERSION */
2274 //SOURCE: https://planetcalc.com/7779
2275 toLinear: (c) => {
2276 const n = c / 255;
2277 return c > .03928 ? Math.pow(((n + .055) / 1.055), 2.4) : n / 12.92;
2278 },
2279 //SOURCE: https://gist.github.com/mjackson/5311256
2280 hue2rgb: (p, q, t) => {
2281 if (t < 0)
2282 t += 1;
2283 if (t > 1)
2284 t -= 1;
2285 if (t < 1 / 6)
2286 return p + (q - p) * 6 * t;
2287 if (t < 1 / 2)
2288 return q;
2289 if (t < 2 / 3)
2290 return p + (q - p) * (2 / 3 - t) * 6;
2291 return p;
2292 },
2293 hsl2rgb: ({ h, s, l }, channel) => {
2294 if (!s)
2295 return l * 2.55; // Achromatic
2296 h /= 360;
2297 s /= 100;
2298 l /= 100;
2299 const q = (l < .5) ? l * (1 + s) : (l + s) - (l * s);
2300 const p = 2 * l - q;
2301 switch (channel) {
2302 case 'r': return Channel.hue2rgb(p, q, h + 1 / 3) * 255;
2303 case 'g': return Channel.hue2rgb(p, q, h) * 255;
2304 case 'b': return Channel.hue2rgb(p, q, h - 1 / 3) * 255;
2305 }
2306 },
2307 rgb2hsl: ({ r, g, b }, channel) => {
2308 r /= 255;
2309 g /= 255;
2310 b /= 255;
2311 const max = Math.max(r, g, b);
2312 const min = Math.min(r, g, b);
2313 const l = (max + min) / 2;
2314 if (channel === 'l')
2315 return l * 100;
2316 if (max === min)
2317 return 0; // Achromatic
2318 const d = max - min;
2319 const s = (l > .5) ? d / (2 - max - min) : d / (max + min);
2320 if (channel === 's')
2321 return s * 100;
2322 switch (max) {
2323 case r: return ((g - b) / d + (g < b ? 6 : 0)) * 60;
2324 case g: return ((b - r) / d + 2) * 60;
2325 case b: return ((r - g) / d + 4) * 60;
2326 default: return -1; //TSC: TypeScript is stupid and complains if there isn't this useless default statement
2327 }
2328 }
2329 };
2330 /* EXPORT */
2331 /* harmony default export */ const channel = (Channel);
2332
2333 ;// CONCATENATED MODULE: ../node_modules/khroma/dist/utils/lang.js
2334 /* MAIN */
2335 const Lang = {
2336 /* API */
2337 clamp: (number, lower, upper) => {
2338 if (lower > upper)
2339 return Math.min(lower, Math.max(upper, number));
2340 return Math.min(upper, Math.max(lower, number));
2341 },
2342 round: (number) => {
2343 return Math.round(number * 10000000000) / 10000000000;
2344 }
2345 };
2346 /* EXPORT */
2347 /* harmony default export */ const lang = (Lang);
2348
2349 ;// CONCATENATED MODULE: ../node_modules/khroma/dist/utils/unit.js
2350 /* MAIN */
2351 const Unit = {
2352 /* API */
2353 dec2hex: (dec) => {
2354 const hex = Math.round(dec).toString(16);
2355 return hex.length > 1 ? hex : `0${hex}`;
2356 }
2357 };
2358 /* EXPORT */
2359 /* harmony default export */ const unit = (Unit);
2360
2361 ;// CONCATENATED MODULE: ../node_modules/khroma/dist/utils/index.js
2362 /* IMPORT */
2363
2364
2365
2366 /* MAIN */
2367 const Utils = {
2368 channel: channel,
2369 lang: lang,
2370 unit: unit
2371 };
2372 /* EXPORT */
2373 /* harmony default export */ const utils = (Utils);
2374
2375
2376 /***/ }),
2377
2378 /***/ 91138:
2379 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2380
2381 "use strict";
2382
2383 // EXPORTS
2384 __webpack_require__.d(__webpack_exports__, {
2385 Z: () => (/* binding */ _ListCache)
2386 });
2387
2388 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_listCacheClear.js
2389 /**
2390 * Removes all key-value entries from the list cache.
2391 *
2392 * @private
2393 * @name clear
2394 * @memberOf ListCache
2395 */
2396 function listCacheClear() {
2397 this.__data__ = [];
2398 this.size = 0;
2399 }
2400
2401 /* harmony default export */ const _listCacheClear = (listCacheClear);
2402
2403 // EXTERNAL MODULE: ../node_modules/lodash-es/eq.js
2404 var eq = __webpack_require__(35050);
2405 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_assocIndexOf.js
2406
2407
2408 /**
2409 * Gets the index at which the `key` is found in `array` of key-value pairs.
2410 *
2411 * @private
2412 * @param {Array} array The array to inspect.
2413 * @param {*} key The key to search for.
2414 * @returns {number} Returns the index of the matched value, else `-1`.
2415 */
2416 function assocIndexOf(array, key) {
2417 var length = array.length;
2418 while (length--) {
2419 if ((0,eq/* default */.Z)(array[length][0], key)) {
2420 return length;
2421 }
2422 }
2423 return -1;
2424 }
2425
2426 /* harmony default export */ const _assocIndexOf = (assocIndexOf);
2427
2428 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_listCacheDelete.js
2429
2430
2431 /** Used for built-in method references. */
2432 var arrayProto = Array.prototype;
2433
2434 /** Built-in value references. */
2435 var splice = arrayProto.splice;
2436
2437 /**
2438 * Removes `key` and its value from the list cache.
2439 *
2440 * @private
2441 * @name delete
2442 * @memberOf ListCache
2443 * @param {string} key The key of the value to remove.
2444 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
2445 */
2446 function listCacheDelete(key) {
2447 var data = this.__data__,
2448 index = _assocIndexOf(data, key);
2449
2450 if (index < 0) {
2451 return false;
2452 }
2453 var lastIndex = data.length - 1;
2454 if (index == lastIndex) {
2455 data.pop();
2456 } else {
2457 splice.call(data, index, 1);
2458 }
2459 --this.size;
2460 return true;
2461 }
2462
2463 /* harmony default export */ const _listCacheDelete = (listCacheDelete);
2464
2465 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_listCacheGet.js
2466
2467
2468 /**
2469 * Gets the list cache value for `key`.
2470 *
2471 * @private
2472 * @name get
2473 * @memberOf ListCache
2474 * @param {string} key The key of the value to get.
2475 * @returns {*} Returns the entry value.
2476 */
2477 function listCacheGet(key) {
2478 var data = this.__data__,
2479 index = _assocIndexOf(data, key);
2480
2481 return index < 0 ? undefined : data[index][1];
2482 }
2483
2484 /* harmony default export */ const _listCacheGet = (listCacheGet);
2485
2486 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_listCacheHas.js
2487
2488
2489 /**
2490 * Checks if a list cache value for `key` exists.
2491 *
2492 * @private
2493 * @name has
2494 * @memberOf ListCache
2495 * @param {string} key The key of the entry to check.
2496 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
2497 */
2498 function listCacheHas(key) {
2499 return _assocIndexOf(this.__data__, key) > -1;
2500 }
2501
2502 /* harmony default export */ const _listCacheHas = (listCacheHas);
2503
2504 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_listCacheSet.js
2505
2506
2507 /**
2508 * Sets the list cache `key` to `value`.
2509 *
2510 * @private
2511 * @name set
2512 * @memberOf ListCache
2513 * @param {string} key The key of the value to set.
2514 * @param {*} value The value to set.
2515 * @returns {Object} Returns the list cache instance.
2516 */
2517 function listCacheSet(key, value) {
2518 var data = this.__data__,
2519 index = _assocIndexOf(data, key);
2520
2521 if (index < 0) {
2522 ++this.size;
2523 data.push([key, value]);
2524 } else {
2525 data[index][1] = value;
2526 }
2527 return this;
2528 }
2529
2530 /* harmony default export */ const _listCacheSet = (listCacheSet);
2531
2532 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_ListCache.js
2533
2534
2535
2536
2537
2538
2539 /**
2540 * Creates an list cache object.
2541 *
2542 * @private
2543 * @constructor
2544 * @param {Array} [entries] The key-value pairs to cache.
2545 */
2546 function ListCache(entries) {
2547 var index = -1,
2548 length = entries == null ? 0 : entries.length;
2549
2550 this.clear();
2551 while (++index < length) {
2552 var entry = entries[index];
2553 this.set(entry[0], entry[1]);
2554 }
2555 }
2556
2557 // Add methods to `ListCache`.
2558 ListCache.prototype.clear = _listCacheClear;
2559 ListCache.prototype['delete'] = _listCacheDelete;
2560 ListCache.prototype.get = _listCacheGet;
2561 ListCache.prototype.has = _listCacheHas;
2562 ListCache.prototype.set = _listCacheSet;
2563
2564 /* harmony default export */ const _ListCache = (ListCache);
2565
2566
2567 /***/ }),
2568
2569 /***/ 81700:
2570 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2571
2572 "use strict";
2573 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2574 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
2575 /* harmony export */ });
2576 /* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26266);
2577 /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(94311);
2578
2579
2580
2581 /* Built-in method references that are verified to be native. */
2582 var Map = (0,_getNative_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(_root_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, 'Map');
2583
2584 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Map);
2585
2586
2587 /***/ }),
2588
2589 /***/ 24395:
2590 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2591
2592 "use strict";
2593
2594 // EXPORTS
2595 __webpack_require__.d(__webpack_exports__, {
2596 Z: () => (/* binding */ _MapCache)
2597 });
2598
2599 // EXTERNAL MODULE: ../node_modules/lodash-es/_getNative.js + 4 modules
2600 var _getNative = __webpack_require__(26266);
2601 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_nativeCreate.js
2602
2603
2604 /* Built-in method references that are verified to be native. */
2605 var nativeCreate = (0,_getNative/* default */.Z)(Object, 'create');
2606
2607 /* harmony default export */ const _nativeCreate = (nativeCreate);
2608
2609 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_hashClear.js
2610
2611
2612 /**
2613 * Removes all key-value entries from the hash.
2614 *
2615 * @private
2616 * @name clear
2617 * @memberOf Hash
2618 */
2619 function hashClear() {
2620 this.__data__ = _nativeCreate ? _nativeCreate(null) : {};
2621 this.size = 0;
2622 }
2623
2624 /* harmony default export */ const _hashClear = (hashClear);
2625
2626 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_hashDelete.js
2627 /**
2628 * Removes `key` and its value from the hash.
2629 *
2630 * @private
2631 * @name delete
2632 * @memberOf Hash
2633 * @param {Object} hash The hash to modify.
2634 * @param {string} key The key of the value to remove.
2635 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
2636 */
2637 function hashDelete(key) {
2638 var result = this.has(key) && delete this.__data__[key];
2639 this.size -= result ? 1 : 0;
2640 return result;
2641 }
2642
2643 /* harmony default export */ const _hashDelete = (hashDelete);
2644
2645 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_hashGet.js
2646
2647
2648 /** Used to stand-in for `undefined` hash values. */
2649 var HASH_UNDEFINED = '__lodash_hash_undefined__';
2650
2651 /** Used for built-in method references. */
2652 var objectProto = Object.prototype;
2653
2654 /** Used to check objects for own properties. */
2655 var _hashGet_hasOwnProperty = objectProto.hasOwnProperty;
2656
2657 /**
2658 * Gets the hash value for `key`.
2659 *
2660 * @private
2661 * @name get
2662 * @memberOf Hash
2663 * @param {string} key The key of the value to get.
2664 * @returns {*} Returns the entry value.
2665 */
2666 function hashGet(key) {
2667 var data = this.__data__;
2668 if (_nativeCreate) {
2669 var result = data[key];
2670 return result === HASH_UNDEFINED ? undefined : result;
2671 }
2672 return _hashGet_hasOwnProperty.call(data, key) ? data[key] : undefined;
2673 }
2674
2675 /* harmony default export */ const _hashGet = (hashGet);
2676
2677 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_hashHas.js
2678
2679
2680 /** Used for built-in method references. */
2681 var _hashHas_objectProto = Object.prototype;
2682
2683 /** Used to check objects for own properties. */
2684 var _hashHas_hasOwnProperty = _hashHas_objectProto.hasOwnProperty;
2685
2686 /**
2687 * Checks if a hash value for `key` exists.
2688 *
2689 * @private
2690 * @name has
2691 * @memberOf Hash
2692 * @param {string} key The key of the entry to check.
2693 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
2694 */
2695 function hashHas(key) {
2696 var data = this.__data__;
2697 return _nativeCreate ? (data[key] !== undefined) : _hashHas_hasOwnProperty.call(data, key);
2698 }
2699
2700 /* harmony default export */ const _hashHas = (hashHas);
2701
2702 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_hashSet.js
2703
2704
2705 /** Used to stand-in for `undefined` hash values. */
2706 var _hashSet_HASH_UNDEFINED = '__lodash_hash_undefined__';
2707
2708 /**
2709 * Sets the hash `key` to `value`.
2710 *
2711 * @private
2712 * @name set
2713 * @memberOf Hash
2714 * @param {string} key The key of the value to set.
2715 * @param {*} value The value to set.
2716 * @returns {Object} Returns the hash instance.
2717 */
2718 function hashSet(key, value) {
2719 var data = this.__data__;
2720 this.size += this.has(key) ? 0 : 1;
2721 data[key] = (_nativeCreate && value === undefined) ? _hashSet_HASH_UNDEFINED : value;
2722 return this;
2723 }
2724
2725 /* harmony default export */ const _hashSet = (hashSet);
2726
2727 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_Hash.js
2728
2729
2730
2731
2732
2733
2734 /**
2735 * Creates a hash object.
2736 *
2737 * @private
2738 * @constructor
2739 * @param {Array} [entries] The key-value pairs to cache.
2740 */
2741 function Hash(entries) {
2742 var index = -1,
2743 length = entries == null ? 0 : entries.length;
2744
2745 this.clear();
2746 while (++index < length) {
2747 var entry = entries[index];
2748 this.set(entry[0], entry[1]);
2749 }
2750 }
2751
2752 // Add methods to `Hash`.
2753 Hash.prototype.clear = _hashClear;
2754 Hash.prototype['delete'] = _hashDelete;
2755 Hash.prototype.get = _hashGet;
2756 Hash.prototype.has = _hashHas;
2757 Hash.prototype.set = _hashSet;
2758
2759 /* harmony default export */ const _Hash = (Hash);
2760
2761 // EXTERNAL MODULE: ../node_modules/lodash-es/_ListCache.js + 6 modules
2762 var _ListCache = __webpack_require__(91138);
2763 // EXTERNAL MODULE: ../node_modules/lodash-es/_Map.js
2764 var _Map = __webpack_require__(81700);
2765 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_mapCacheClear.js
2766
2767
2768
2769
2770 /**
2771 * Removes all key-value entries from the map.
2772 *
2773 * @private
2774 * @name clear
2775 * @memberOf MapCache
2776 */
2777 function mapCacheClear() {
2778 this.size = 0;
2779 this.__data__ = {
2780 'hash': new _Hash,
2781 'map': new (_Map/* default */.Z || _ListCache/* default */.Z),
2782 'string': new _Hash
2783 };
2784 }
2785
2786 /* harmony default export */ const _mapCacheClear = (mapCacheClear);
2787
2788 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_isKeyable.js
2789 /**
2790 * Checks if `value` is suitable for use as unique object key.
2791 *
2792 * @private
2793 * @param {*} value The value to check.
2794 * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
2795 */
2796 function isKeyable(value) {
2797 var type = typeof value;
2798 return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
2799 ? (value !== '__proto__')
2800 : (value === null);
2801 }
2802
2803 /* harmony default export */ const _isKeyable = (isKeyable);
2804
2805 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_getMapData.js
2806
2807
2808 /**
2809 * Gets the data for `map`.
2810 *
2811 * @private
2812 * @param {Object} map The map to query.
2813 * @param {string} key The reference key.
2814 * @returns {*} Returns the map data.
2815 */
2816 function getMapData(map, key) {
2817 var data = map.__data__;
2818 return _isKeyable(key)
2819 ? data[typeof key == 'string' ? 'string' : 'hash']
2820 : data.map;
2821 }
2822
2823 /* harmony default export */ const _getMapData = (getMapData);
2824
2825 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_mapCacheDelete.js
2826
2827
2828 /**
2829 * Removes `key` and its value from the map.
2830 *
2831 * @private
2832 * @name delete
2833 * @memberOf MapCache
2834 * @param {string} key The key of the value to remove.
2835 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
2836 */
2837 function mapCacheDelete(key) {
2838 var result = _getMapData(this, key)['delete'](key);
2839 this.size -= result ? 1 : 0;
2840 return result;
2841 }
2842
2843 /* harmony default export */ const _mapCacheDelete = (mapCacheDelete);
2844
2845 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_mapCacheGet.js
2846
2847
2848 /**
2849 * Gets the map value for `key`.
2850 *
2851 * @private
2852 * @name get
2853 * @memberOf MapCache
2854 * @param {string} key The key of the value to get.
2855 * @returns {*} Returns the entry value.
2856 */
2857 function mapCacheGet(key) {
2858 return _getMapData(this, key).get(key);
2859 }
2860
2861 /* harmony default export */ const _mapCacheGet = (mapCacheGet);
2862
2863 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_mapCacheHas.js
2864
2865
2866 /**
2867 * Checks if a map value for `key` exists.
2868 *
2869 * @private
2870 * @name has
2871 * @memberOf MapCache
2872 * @param {string} key The key of the entry to check.
2873 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
2874 */
2875 function mapCacheHas(key) {
2876 return _getMapData(this, key).has(key);
2877 }
2878
2879 /* harmony default export */ const _mapCacheHas = (mapCacheHas);
2880
2881 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_mapCacheSet.js
2882
2883
2884 /**
2885 * Sets the map `key` to `value`.
2886 *
2887 * @private
2888 * @name set
2889 * @memberOf MapCache
2890 * @param {string} key The key of the value to set.
2891 * @param {*} value The value to set.
2892 * @returns {Object} Returns the map cache instance.
2893 */
2894 function mapCacheSet(key, value) {
2895 var data = _getMapData(this, key),
2896 size = data.size;
2897
2898 data.set(key, value);
2899 this.size += data.size == size ? 0 : 1;
2900 return this;
2901 }
2902
2903 /* harmony default export */ const _mapCacheSet = (mapCacheSet);
2904
2905 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_MapCache.js
2906
2907
2908
2909
2910
2911
2912 /**
2913 * Creates a map cache object to store key-value pairs.
2914 *
2915 * @private
2916 * @constructor
2917 * @param {Array} [entries] The key-value pairs to cache.
2918 */
2919 function MapCache(entries) {
2920 var index = -1,
2921 length = entries == null ? 0 : entries.length;
2922
2923 this.clear();
2924 while (++index < length) {
2925 var entry = entries[index];
2926 this.set(entry[0], entry[1]);
2927 }
2928 }
2929
2930 // Add methods to `MapCache`.
2931 MapCache.prototype.clear = _mapCacheClear;
2932 MapCache.prototype['delete'] = _mapCacheDelete;
2933 MapCache.prototype.get = _mapCacheGet;
2934 MapCache.prototype.has = _mapCacheHas;
2935 MapCache.prototype.set = _mapCacheSet;
2936
2937 /* harmony default export */ const _MapCache = (MapCache);
2938
2939
2940 /***/ }),
2941
2942 /***/ 16889:
2943 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2944
2945 "use strict";
2946 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2947 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
2948 /* harmony export */ });
2949 /* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26266);
2950 /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(94311);
2951
2952
2953
2954 /* Built-in method references that are verified to be native. */
2955 var Set = (0,_getNative_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(_root_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, 'Set');
2956
2957 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Set);
2958
2959
2960 /***/ }),
2961
2962 /***/ 82948:
2963 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2964
2965 "use strict";
2966
2967 // EXPORTS
2968 __webpack_require__.d(__webpack_exports__, {
2969 Z: () => (/* binding */ _Stack)
2970 });
2971
2972 // EXTERNAL MODULE: ../node_modules/lodash-es/_ListCache.js + 6 modules
2973 var _ListCache = __webpack_require__(91138);
2974 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_stackClear.js
2975
2976
2977 /**
2978 * Removes all key-value entries from the stack.
2979 *
2980 * @private
2981 * @name clear
2982 * @memberOf Stack
2983 */
2984 function stackClear() {
2985 this.__data__ = new _ListCache/* default */.Z;
2986 this.size = 0;
2987 }
2988
2989 /* harmony default export */ const _stackClear = (stackClear);
2990
2991 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_stackDelete.js
2992 /**
2993 * Removes `key` and its value from the stack.
2994 *
2995 * @private
2996 * @name delete
2997 * @memberOf Stack
2998 * @param {string} key The key of the value to remove.
2999 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
3000 */
3001 function stackDelete(key) {
3002 var data = this.__data__,
3003 result = data['delete'](key);
3004
3005 this.size = data.size;
3006 return result;
3007 }
3008
3009 /* harmony default export */ const _stackDelete = (stackDelete);
3010
3011 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_stackGet.js
3012 /**
3013 * Gets the stack value for `key`.
3014 *
3015 * @private
3016 * @name get
3017 * @memberOf Stack
3018 * @param {string} key The key of the value to get.
3019 * @returns {*} Returns the entry value.
3020 */
3021 function stackGet(key) {
3022 return this.__data__.get(key);
3023 }
3024
3025 /* harmony default export */ const _stackGet = (stackGet);
3026
3027 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_stackHas.js
3028 /**
3029 * Checks if a stack value for `key` exists.
3030 *
3031 * @private
3032 * @name has
3033 * @memberOf Stack
3034 * @param {string} key The key of the entry to check.
3035 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
3036 */
3037 function stackHas(key) {
3038 return this.__data__.has(key);
3039 }
3040
3041 /* harmony default export */ const _stackHas = (stackHas);
3042
3043 // EXTERNAL MODULE: ../node_modules/lodash-es/_Map.js
3044 var _Map = __webpack_require__(81700);
3045 // EXTERNAL MODULE: ../node_modules/lodash-es/_MapCache.js + 14 modules
3046 var _MapCache = __webpack_require__(24395);
3047 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_stackSet.js
3048
3049
3050
3051
3052 /** Used as the size to enable large array optimizations. */
3053 var LARGE_ARRAY_SIZE = 200;
3054
3055 /**
3056 * Sets the stack `key` to `value`.
3057 *
3058 * @private
3059 * @name set
3060 * @memberOf Stack
3061 * @param {string} key The key of the value to set.
3062 * @param {*} value The value to set.
3063 * @returns {Object} Returns the stack cache instance.
3064 */
3065 function stackSet(key, value) {
3066 var data = this.__data__;
3067 if (data instanceof _ListCache/* default */.Z) {
3068 var pairs = data.__data__;
3069 if (!_Map/* default */.Z || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
3070 pairs.push([key, value]);
3071 this.size = ++data.size;
3072 return this;
3073 }
3074 data = this.__data__ = new _MapCache/* default */.Z(pairs);
3075 }
3076 data.set(key, value);
3077 this.size = data.size;
3078 return this;
3079 }
3080
3081 /* harmony default export */ const _stackSet = (stackSet);
3082
3083 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_Stack.js
3084
3085
3086
3087
3088
3089
3090
3091 /**
3092 * Creates a stack cache object to store key-value pairs.
3093 *
3094 * @private
3095 * @constructor
3096 * @param {Array} [entries] The key-value pairs to cache.
3097 */
3098 function Stack(entries) {
3099 var data = this.__data__ = new _ListCache/* default */.Z(entries);
3100 this.size = data.size;
3101 }
3102
3103 // Add methods to `Stack`.
3104 Stack.prototype.clear = _stackClear;
3105 Stack.prototype['delete'] = _stackDelete;
3106 Stack.prototype.get = _stackGet;
3107 Stack.prototype.has = _stackHas;
3108 Stack.prototype.set = _stackSet;
3109
3110 /* harmony default export */ const _Stack = (Stack);
3111
3112
3113 /***/ }),
3114
3115 /***/ 91642:
3116 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3117
3118 "use strict";
3119 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3120 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
3121 /* harmony export */ });
3122 /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(94311);
3123
3124
3125 /** Built-in value references. */
3126 var Symbol = _root_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.Symbol;
3127
3128 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Symbol);
3129
3130
3131 /***/ }),
3132
3133 /***/ 41049:
3134 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3135
3136 "use strict";
3137 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3138 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
3139 /* harmony export */ });
3140 /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(94311);
3141
3142
3143 /** Built-in value references. */
3144 var Uint8Array = _root_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.Uint8Array;
3145
3146 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Uint8Array);
3147
3148
3149 /***/ }),
3150
3151 /***/ 40709:
3152 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3153
3154 "use strict";
3155
3156 // EXPORTS
3157 __webpack_require__.d(__webpack_exports__, {
3158 Z: () => (/* binding */ _arrayLikeKeys)
3159 });
3160
3161 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_baseTimes.js
3162 /**
3163 * The base implementation of `_.times` without support for iteratee shorthands
3164 * or max array length checks.
3165 *
3166 * @private
3167 * @param {number} n The number of times to invoke `iteratee`.
3168 * @param {Function} iteratee The function invoked per iteration.
3169 * @returns {Array} Returns the array of results.
3170 */
3171 function baseTimes(n, iteratee) {
3172 var index = -1,
3173 result = Array(n);
3174
3175 while (++index < n) {
3176 result[index] = iteratee(index);
3177 }
3178 return result;
3179 }
3180
3181 /* harmony default export */ const _baseTimes = (baseTimes);
3182
3183 // EXTERNAL MODULE: ../node_modules/lodash-es/isArguments.js + 1 modules
3184 var isArguments = __webpack_require__(9028);
3185 // EXTERNAL MODULE: ../node_modules/lodash-es/isArray.js
3186 var isArray = __webpack_require__(64058);
3187 // EXTERNAL MODULE: ../node_modules/lodash-es/isBuffer.js + 1 modules
3188 var isBuffer = __webpack_require__(23230);
3189 // EXTERNAL MODULE: ../node_modules/lodash-es/_isIndex.js
3190 var _isIndex = __webpack_require__(8616);
3191 // EXTERNAL MODULE: ../node_modules/lodash-es/isTypedArray.js + 1 modules
3192 var isTypedArray = __webpack_require__(14923);
3193 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_arrayLikeKeys.js
3194
3195
3196
3197
3198
3199
3200
3201 /** Used for built-in method references. */
3202 var objectProto = Object.prototype;
3203
3204 /** Used to check objects for own properties. */
3205 var _arrayLikeKeys_hasOwnProperty = objectProto.hasOwnProperty;
3206
3207 /**
3208 * Creates an array of the enumerable property names of the array-like `value`.
3209 *
3210 * @private
3211 * @param {*} value The value to query.
3212 * @param {boolean} inherited Specify returning inherited property names.
3213 * @returns {Array} Returns the array of property names.
3214 */
3215 function arrayLikeKeys(value, inherited) {
3216 var isArr = (0,isArray/* default */.Z)(value),
3217 isArg = !isArr && (0,isArguments/* default */.Z)(value),
3218 isBuff = !isArr && !isArg && (0,isBuffer/* default */.Z)(value),
3219 isType = !isArr && !isArg && !isBuff && (0,isTypedArray/* default */.Z)(value),
3220 skipIndexes = isArr || isArg || isBuff || isType,
3221 result = skipIndexes ? _baseTimes(value.length, String) : [],
3222 length = result.length;
3223
3224 for (var key in value) {
3225 if ((inherited || _arrayLikeKeys_hasOwnProperty.call(value, key)) &&
3226 !(skipIndexes && (
3227 // Safari 9 has enumerable `arguments.length` in strict mode.
3228 key == 'length' ||
3229 // Node.js 0.10 has enumerable non-index properties on buffers.
3230 (isBuff && (key == 'offset' || key == 'parent')) ||
3231 // PhantomJS 2 has enumerable non-index properties on typed arrays.
3232 (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
3233 // Skip index properties.
3234 (0,_isIndex/* default */.Z)(key, length)
3235 ))) {
3236 result.push(key);
3237 }
3238 }
3239 return result;
3240 }
3241
3242 /* harmony default export */ const _arrayLikeKeys = (arrayLikeKeys);
3243
3244
3245 /***/ }),
3246
3247 /***/ 15561:
3248 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3249
3250 "use strict";
3251 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3252 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
3253 /* harmony export */ });
3254 /* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(93586);
3255 /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(35050);
3256
3257
3258
3259 /** Used for built-in method references. */
3260 var objectProto = Object.prototype;
3261
3262 /** Used to check objects for own properties. */
3263 var hasOwnProperty = objectProto.hasOwnProperty;
3264
3265 /**
3266 * Assigns `value` to `key` of `object` if the existing value is not equivalent
3267 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
3268 * for equality comparisons.
3269 *
3270 * @private
3271 * @param {Object} object The object to modify.
3272 * @param {string} key The key of the property to assign.
3273 * @param {*} value The value to assign.
3274 */
3275 function assignValue(object, key, value) {
3276 var objValue = object[key];
3277 if (!(hasOwnProperty.call(object, key) && (0,_eq_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(objValue, value)) ||
3278 (value === undefined && !(key in object))) {
3279 (0,_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(object, key, value);
3280 }
3281 }
3282
3283 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (assignValue);
3284
3285
3286 /***/ }),
3287
3288 /***/ 93586:
3289 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3290
3291 "use strict";
3292 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3293 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
3294 /* harmony export */ });
3295 /* harmony import */ var _defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(30253);
3296
3297
3298 /**
3299 * The base implementation of `assignValue` and `assignMergeValue` without
3300 * value checks.
3301 *
3302 * @private
3303 * @param {Object} object The object to modify.
3304 * @param {string} key The key of the property to assign.
3305 * @param {*} value The value to assign.
3306 */
3307 function baseAssignValue(object, key, value) {
3308 if (key == '__proto__' && _defineProperty_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z) {
3309 (0,_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(object, key, {
3310 'configurable': true,
3311 'enumerable': true,
3312 'value': value,
3313 'writable': true
3314 });
3315 } else {
3316 object[key] = value;
3317 }
3318 }
3319
3320 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseAssignValue);
3321
3322
3323 /***/ }),
3324
3325 /***/ 49399:
3326 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3327
3328 "use strict";
3329
3330 // EXPORTS
3331 __webpack_require__.d(__webpack_exports__, {
3332 Z: () => (/* binding */ _baseFor)
3333 });
3334
3335 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_createBaseFor.js
3336 /**
3337 * Creates a base function for methods like `_.forIn` and `_.forOwn`.
3338 *
3339 * @private
3340 * @param {boolean} [fromRight] Specify iterating from right to left.
3341 * @returns {Function} Returns the new base function.
3342 */
3343 function createBaseFor(fromRight) {
3344 return function(object, iteratee, keysFunc) {
3345 var index = -1,
3346 iterable = Object(object),
3347 props = keysFunc(object),
3348 length = props.length;
3349
3350 while (length--) {
3351 var key = props[fromRight ? length : ++index];
3352 if (iteratee(iterable[key], key, iterable) === false) {
3353 break;
3354 }
3355 }
3356 return object;
3357 };
3358 }
3359
3360 /* harmony default export */ const _createBaseFor = (createBaseFor);
3361
3362 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_baseFor.js
3363
3364
3365 /**
3366 * The base implementation of `baseForOwn` which iterates over `object`
3367 * properties returned by `keysFunc` and invokes `iteratee` for each property.
3368 * Iteratee functions may exit iteration early by explicitly returning `false`.
3369 *
3370 * @private
3371 * @param {Object} object The object to iterate over.
3372 * @param {Function} iteratee The function invoked per iteration.
3373 * @param {Function} keysFunc The function to get the keys of `object`.
3374 * @returns {Object} Returns `object`.
3375 */
3376 var baseFor = _createBaseFor();
3377
3378 /* harmony default export */ const _baseFor = (baseFor);
3379
3380
3381 /***/ }),
3382
3383 /***/ 77070:
3384 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3385
3386 "use strict";
3387
3388 // EXPORTS
3389 __webpack_require__.d(__webpack_exports__, {
3390 Z: () => (/* binding */ _baseGetTag)
3391 });
3392
3393 // EXTERNAL MODULE: ../node_modules/lodash-es/_Symbol.js
3394 var _Symbol = __webpack_require__(91642);
3395 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_getRawTag.js
3396
3397
3398 /** Used for built-in method references. */
3399 var objectProto = Object.prototype;
3400
3401 /** Used to check objects for own properties. */
3402 var _getRawTag_hasOwnProperty = objectProto.hasOwnProperty;
3403
3404 /**
3405 * Used to resolve the
3406 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
3407 * of values.
3408 */
3409 var nativeObjectToString = objectProto.toString;
3410
3411 /** Built-in value references. */
3412 var symToStringTag = _Symbol/* default */.Z ? _Symbol/* default */.Z.toStringTag : undefined;
3413
3414 /**
3415 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
3416 *
3417 * @private
3418 * @param {*} value The value to query.
3419 * @returns {string} Returns the raw `toStringTag`.
3420 */
3421 function getRawTag(value) {
3422 var isOwn = _getRawTag_hasOwnProperty.call(value, symToStringTag),
3423 tag = value[symToStringTag];
3424
3425 try {
3426 value[symToStringTag] = undefined;
3427 var unmasked = true;
3428 } catch (e) {}
3429
3430 var result = nativeObjectToString.call(value);
3431 if (unmasked) {
3432 if (isOwn) {
3433 value[symToStringTag] = tag;
3434 } else {
3435 delete value[symToStringTag];
3436 }
3437 }
3438 return result;
3439 }
3440
3441 /* harmony default export */ const _getRawTag = (getRawTag);
3442
3443 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_objectToString.js
3444 /** Used for built-in method references. */
3445 var _objectToString_objectProto = Object.prototype;
3446
3447 /**
3448 * Used to resolve the
3449 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
3450 * of values.
3451 */
3452 var _objectToString_nativeObjectToString = _objectToString_objectProto.toString;
3453
3454 /**
3455 * Converts `value` to a string using `Object.prototype.toString`.
3456 *
3457 * @private
3458 * @param {*} value The value to convert.
3459 * @returns {string} Returns the converted string.
3460 */
3461 function objectToString(value) {
3462 return _objectToString_nativeObjectToString.call(value);
3463 }
3464
3465 /* harmony default export */ const _objectToString = (objectToString);
3466
3467 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_baseGetTag.js
3468
3469
3470
3471
3472 /** `Object#toString` result references. */
3473 var nullTag = '[object Null]',
3474 undefinedTag = '[object Undefined]';
3475
3476 /** Built-in value references. */
3477 var _baseGetTag_symToStringTag = _Symbol/* default */.Z ? _Symbol/* default */.Z.toStringTag : undefined;
3478
3479 /**
3480 * The base implementation of `getTag` without fallbacks for buggy environments.
3481 *
3482 * @private
3483 * @param {*} value The value to query.
3484 * @returns {string} Returns the `toStringTag`.
3485 */
3486 function baseGetTag(value) {
3487 if (value == null) {
3488 return value === undefined ? undefinedTag : nullTag;
3489 }
3490 return (_baseGetTag_symToStringTag && _baseGetTag_symToStringTag in Object(value))
3491 ? _getRawTag(value)
3492 : _objectToString(value);
3493 }
3494
3495 /* harmony default export */ const _baseGetTag = (baseGetTag);
3496
3497
3498 /***/ }),
3499
3500 /***/ 45934:
3501 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3502
3503 "use strict";
3504
3505 // EXPORTS
3506 __webpack_require__.d(__webpack_exports__, {
3507 Z: () => (/* binding */ _baseKeys)
3508 });
3509
3510 // EXTERNAL MODULE: ../node_modules/lodash-es/_isPrototype.js
3511 var _isPrototype = __webpack_require__(89418);
3512 // EXTERNAL MODULE: ../node_modules/lodash-es/_overArg.js
3513 var _overArg = __webpack_require__(4883);
3514 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_nativeKeys.js
3515
3516
3517 /* Built-in method references for those with the same name as other `lodash` methods. */
3518 var nativeKeys = (0,_overArg/* default */.Z)(Object.keys, Object);
3519
3520 /* harmony default export */ const _nativeKeys = (nativeKeys);
3521
3522 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_baseKeys.js
3523
3524
3525
3526 /** Used for built-in method references. */
3527 var objectProto = Object.prototype;
3528
3529 /** Used to check objects for own properties. */
3530 var _baseKeys_hasOwnProperty = objectProto.hasOwnProperty;
3531
3532 /**
3533 * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
3534 *
3535 * @private
3536 * @param {Object} object The object to query.
3537 * @returns {Array} Returns the array of property names.
3538 */
3539 function baseKeys(object) {
3540 if (!(0,_isPrototype/* default */.Z)(object)) {
3541 return _nativeKeys(object);
3542 }
3543 var result = [];
3544 for (var key in Object(object)) {
3545 if (_baseKeys_hasOwnProperty.call(object, key) && key != 'constructor') {
3546 result.push(key);
3547 }
3548 }
3549 return result;
3550 }
3551
3552 /* harmony default export */ const _baseKeys = (baseKeys);
3553
3554
3555 /***/ }),
3556
3557 /***/ 99719:
3558 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3559
3560 "use strict";
3561 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3562 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
3563 /* harmony export */ });
3564 /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(64056);
3565 /* harmony import */ var _overRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15829);
3566 /* harmony import */ var _setToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71649);
3567
3568
3569
3570
3571 /**
3572 * The base implementation of `_.rest` which doesn't validate or coerce arguments.
3573 *
3574 * @private
3575 * @param {Function} func The function to apply a rest parameter to.
3576 * @param {number} [start=func.length-1] The start position of the rest parameter.
3577 * @returns {Function} Returns the new function.
3578 */
3579 function baseRest(func, start) {
3580 return (0,_setToString_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)((0,_overRest_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(func, start, _identity_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z), func + '');
3581 }
3582
3583 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseRest);
3584
3585
3586 /***/ }),
3587
3588 /***/ 20274:
3589 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3590
3591 "use strict";
3592 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3593 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
3594 /* harmony export */ });
3595 /**
3596 * The base implementation of `_.unary` without support for storing metadata.
3597 *
3598 * @private
3599 * @param {Function} func The function to cap arguments for.
3600 * @returns {Function} Returns the new capped function.
3601 */
3602 function baseUnary(func) {
3603 return function(value) {
3604 return func(value);
3605 };
3606 }
3607
3608 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseUnary);
3609
3610
3611 /***/ }),
3612
3613 /***/ 52049:
3614 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3615
3616 "use strict";
3617 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3618 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
3619 /* harmony export */ });
3620 /* harmony import */ var _Uint8Array_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(41049);
3621
3622
3623 /**
3624 * Creates a clone of `arrayBuffer`.
3625 *
3626 * @private
3627 * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
3628 * @returns {ArrayBuffer} Returns the cloned array buffer.
3629 */
3630 function cloneArrayBuffer(arrayBuffer) {
3631 var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
3632 new _Uint8Array_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z(result).set(new _Uint8Array_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z(arrayBuffer));
3633 return result;
3634 }
3635
3636 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (cloneArrayBuffer);
3637
3638
3639 /***/ }),
3640
3641 /***/ 64405:
3642 /***/ ((module, __webpack_exports__, __webpack_require__) => {
3643
3644 "use strict";
3645 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3646 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
3647 /* harmony export */ });
3648 /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(94311);
3649 /* module decorator */ module = __webpack_require__.hmd(module);
3650
3651
3652 /** Detect free variable `exports`. */
3653 var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
3654
3655 /** Detect free variable `module`. */
3656 var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
3657
3658 /** Detect the popular CommonJS extension `module.exports`. */
3659 var moduleExports = freeModule && freeModule.exports === freeExports;
3660
3661 /** Built-in value references. */
3662 var Buffer = moduleExports ? _root_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.Buffer : undefined,
3663 allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
3664
3665 /**
3666 * Creates a clone of `buffer`.
3667 *
3668 * @private
3669 * @param {Buffer} buffer The buffer to clone.
3670 * @param {boolean} [isDeep] Specify a deep clone.
3671 * @returns {Buffer} Returns the cloned buffer.
3672 */
3673 function cloneBuffer(buffer, isDeep) {
3674 if (isDeep) {
3675 return buffer.slice();
3676 }
3677 var length = buffer.length,
3678 result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
3679
3680 buffer.copy(result);
3681 return result;
3682 }
3683
3684 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (cloneBuffer);
3685
3686
3687 /***/ }),
3688
3689 /***/ 61601:
3690 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3691
3692 "use strict";
3693 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3694 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
3695 /* harmony export */ });
3696 /* harmony import */ var _cloneArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(52049);
3697
3698
3699 /**
3700 * Creates a clone of `typedArray`.
3701 *
3702 * @private
3703 * @param {Object} typedArray The typed array to clone.
3704 * @param {boolean} [isDeep] Specify a deep clone.
3705 * @returns {Object} Returns the cloned typed array.
3706 */
3707 function cloneTypedArray(typedArray, isDeep) {
3708 var buffer = isDeep ? (0,_cloneArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(typedArray.buffer) : typedArray.buffer;
3709 return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
3710 }
3711
3712 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (cloneTypedArray);
3713
3714
3715 /***/ }),
3716
3717 /***/ 93580:
3718 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3719
3720 "use strict";
3721 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3722 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
3723 /* harmony export */ });
3724 /**
3725 * Copies the values of `source` to `array`.
3726 *
3727 * @private
3728 * @param {Array} source The array to copy values from.
3729 * @param {Array} [array=[]] The array to copy values to.
3730 * @returns {Array} Returns `array`.
3731 */
3732 function copyArray(source, array) {
3733 var index = -1,
3734 length = source.length;
3735
3736 array || (array = Array(length));
3737 while (++index < length) {
3738 array[index] = source[index];
3739 }
3740 return array;
3741 }
3742
3743 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (copyArray);
3744
3745
3746 /***/ }),
3747
3748 /***/ 47313:
3749 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3750
3751 "use strict";
3752 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3753 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
3754 /* harmony export */ });
3755 /* harmony import */ var _assignValue_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15561);
3756 /* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(93586);
3757
3758
3759
3760 /**
3761 * Copies properties of `source` to `object`.
3762 *
3763 * @private
3764 * @param {Object} source The object to copy properties from.
3765 * @param {Array} props The property identifiers to copy.
3766 * @param {Object} [object={}] The object to copy properties to.
3767 * @param {Function} [customizer] The function to customize copied values.
3768 * @returns {Object} Returns `object`.
3769 */
3770 function copyObject(source, props, object, customizer) {
3771 var isNew = !object;
3772 object || (object = {});
3773
3774 var index = -1,
3775 length = props.length;
3776
3777 while (++index < length) {
3778 var key = props[index];
3779
3780 var newValue = customizer
3781 ? customizer(object[key], source[key], key, object, source)
3782 : undefined;
3783
3784 if (newValue === undefined) {
3785 newValue = source[key];
3786 }
3787 if (isNew) {
3788 (0,_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(object, key, newValue);
3789 } else {
3790 (0,_assignValue_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(object, key, newValue);
3791 }
3792 }
3793 return object;
3794 }
3795
3796 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (copyObject);
3797
3798
3799 /***/ }),
3800
3801 /***/ 40690:
3802 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3803
3804 "use strict";
3805 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3806 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
3807 /* harmony export */ });
3808 /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(99719);
3809 /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(47952);
3810
3811
3812
3813 /**
3814 * Creates a function like `_.assign`.
3815 *
3816 * @private
3817 * @param {Function} assigner The function to assign values.
3818 * @returns {Function} Returns the new assigner function.
3819 */
3820 function createAssigner(assigner) {
3821 return (0,_baseRest_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(function(object, sources) {
3822 var index = -1,
3823 length = sources.length,
3824 customizer = length > 1 ? sources[length - 1] : undefined,
3825 guard = length > 2 ? sources[2] : undefined;
3826
3827 customizer = (assigner.length > 3 && typeof customizer == 'function')
3828 ? (length--, customizer)
3829 : undefined;
3830
3831 if (guard && (0,_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(sources[0], sources[1], guard)) {
3832 customizer = length < 3 ? undefined : customizer;
3833 length = 1;
3834 }
3835 object = Object(object);
3836 while (++index < length) {
3837 var source = sources[index];
3838 if (source) {
3839 assigner(object, source, index, customizer);
3840 }
3841 }
3842 return object;
3843 });
3844 }
3845
3846 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (createAssigner);
3847
3848
3849 /***/ }),
3850
3851 /***/ 30253:
3852 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3853
3854 "use strict";
3855 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3856 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
3857 /* harmony export */ });
3858 /* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26266);
3859
3860
3861 var defineProperty = (function() {
3862 try {
3863 var func = (0,_getNative_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(Object, 'defineProperty');
3864 func({}, '', {});
3865 return func;
3866 } catch (e) {}
3867 }());
3868
3869 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (defineProperty);
3870
3871
3872 /***/ }),
3873
3874 /***/ 89268:
3875 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3876
3877 "use strict";
3878 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3879 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
3880 /* harmony export */ });
3881 /** Detect free variable `global` from Node.js. */
3882 var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
3883
3884 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (freeGlobal);
3885
3886
3887 /***/ }),
3888
3889 /***/ 26266:
3890 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3891
3892 "use strict";
3893
3894 // EXPORTS
3895 __webpack_require__.d(__webpack_exports__, {
3896 Z: () => (/* binding */ _getNative)
3897 });
3898
3899 // EXTERNAL MODULE: ../node_modules/lodash-es/isFunction.js
3900 var isFunction = __webpack_require__(48489);
3901 // EXTERNAL MODULE: ../node_modules/lodash-es/_root.js
3902 var _root = __webpack_require__(94311);
3903 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_coreJsData.js
3904
3905
3906 /** Used to detect overreaching core-js shims. */
3907 var coreJsData = _root/* default */.Z['__core-js_shared__'];
3908
3909 /* harmony default export */ const _coreJsData = (coreJsData);
3910
3911 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_isMasked.js
3912
3913
3914 /** Used to detect methods masquerading as native. */
3915 var maskSrcKey = (function() {
3916 var uid = /[^.]+$/.exec(_coreJsData && _coreJsData.keys && _coreJsData.keys.IE_PROTO || '');
3917 return uid ? ('Symbol(src)_1.' + uid) : '';
3918 }());
3919
3920 /**
3921 * Checks if `func` has its source masked.
3922 *
3923 * @private
3924 * @param {Function} func The function to check.
3925 * @returns {boolean} Returns `true` if `func` is masked, else `false`.
3926 */
3927 function isMasked(func) {
3928 return !!maskSrcKey && (maskSrcKey in func);
3929 }
3930
3931 /* harmony default export */ const _isMasked = (isMasked);
3932
3933 // EXTERNAL MODULE: ../node_modules/lodash-es/isObject.js
3934 var isObject = __webpack_require__(60417);
3935 // EXTERNAL MODULE: ../node_modules/lodash-es/_toSource.js
3936 var _toSource = __webpack_require__(62392);
3937 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_baseIsNative.js
3938
3939
3940
3941
3942
3943 /**
3944 * Used to match `RegExp`
3945 * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
3946 */
3947 var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
3948
3949 /** Used to detect host constructors (Safari). */
3950 var reIsHostCtor = /^\[object .+?Constructor\]$/;
3951
3952 /** Used for built-in method references. */
3953 var funcProto = Function.prototype,
3954 objectProto = Object.prototype;
3955
3956 /** Used to resolve the decompiled source of functions. */
3957 var funcToString = funcProto.toString;
3958
3959 /** Used to check objects for own properties. */
3960 var _baseIsNative_hasOwnProperty = objectProto.hasOwnProperty;
3961
3962 /** Used to detect if a method is native. */
3963 var reIsNative = RegExp('^' +
3964 funcToString.call(_baseIsNative_hasOwnProperty).replace(reRegExpChar, '\\$&')
3965 .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
3966 );
3967
3968 /**
3969 * The base implementation of `_.isNative` without bad shim checks.
3970 *
3971 * @private
3972 * @param {*} value The value to check.
3973 * @returns {boolean} Returns `true` if `value` is a native function,
3974 * else `false`.
3975 */
3976 function baseIsNative(value) {
3977 if (!(0,isObject/* default */.Z)(value) || _isMasked(value)) {
3978 return false;
3979 }
3980 var pattern = (0,isFunction/* default */.Z)(value) ? reIsNative : reIsHostCtor;
3981 return pattern.test((0,_toSource/* default */.Z)(value));
3982 }
3983
3984 /* harmony default export */ const _baseIsNative = (baseIsNative);
3985
3986 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_getValue.js
3987 /**
3988 * Gets the value at `key` of `object`.
3989 *
3990 * @private
3991 * @param {Object} [object] The object to query.
3992 * @param {string} key The key of the property to get.
3993 * @returns {*} Returns the property value.
3994 */
3995 function getValue(object, key) {
3996 return object == null ? undefined : object[key];
3997 }
3998
3999 /* harmony default export */ const _getValue = (getValue);
4000
4001 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_getNative.js
4002
4003
4004
4005 /**
4006 * Gets the native function at `key` of `object`.
4007 *
4008 * @private
4009 * @param {Object} object The object to query.
4010 * @param {string} key The key of the method to get.
4011 * @returns {*} Returns the function if it's native, else `undefined`.
4012 */
4013 function getNative(object, key) {
4014 var value = _getValue(object, key);
4015 return _baseIsNative(value) ? value : undefined;
4016 }
4017
4018 /* harmony default export */ const _getNative = (getNative);
4019
4020
4021 /***/ }),
4022
4023 /***/ 72784:
4024 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4025
4026 "use strict";
4027 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4028 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
4029 /* harmony export */ });
4030 /* harmony import */ var _overArg_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4883);
4031
4032
4033 /** Built-in value references. */
4034 var getPrototype = (0,_overArg_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(Object.getPrototypeOf, Object);
4035
4036 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getPrototype);
4037
4038
4039 /***/ }),
4040
4041 /***/ 41182:
4042 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4043
4044 "use strict";
4045
4046 // EXPORTS
4047 __webpack_require__.d(__webpack_exports__, {
4048 Z: () => (/* binding */ _getTag)
4049 });
4050
4051 // EXTERNAL MODULE: ../node_modules/lodash-es/_getNative.js + 4 modules
4052 var _getNative = __webpack_require__(26266);
4053 // EXTERNAL MODULE: ../node_modules/lodash-es/_root.js
4054 var _root = __webpack_require__(94311);
4055 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_DataView.js
4056
4057
4058
4059 /* Built-in method references that are verified to be native. */
4060 var DataView = (0,_getNative/* default */.Z)(_root/* default */.Z, 'DataView');
4061
4062 /* harmony default export */ const _DataView = (DataView);
4063
4064 // EXTERNAL MODULE: ../node_modules/lodash-es/_Map.js
4065 var _Map = __webpack_require__(81700);
4066 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_Promise.js
4067
4068
4069
4070 /* Built-in method references that are verified to be native. */
4071 var Promise = (0,_getNative/* default */.Z)(_root/* default */.Z, 'Promise');
4072
4073 /* harmony default export */ const _Promise = (Promise);
4074
4075 // EXTERNAL MODULE: ../node_modules/lodash-es/_Set.js
4076 var _Set = __webpack_require__(16889);
4077 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_WeakMap.js
4078
4079
4080
4081 /* Built-in method references that are verified to be native. */
4082 var WeakMap = (0,_getNative/* default */.Z)(_root/* default */.Z, 'WeakMap');
4083
4084 /* harmony default export */ const _WeakMap = (WeakMap);
4085
4086 // EXTERNAL MODULE: ../node_modules/lodash-es/_baseGetTag.js + 2 modules
4087 var _baseGetTag = __webpack_require__(77070);
4088 // EXTERNAL MODULE: ../node_modules/lodash-es/_toSource.js
4089 var _toSource = __webpack_require__(62392);
4090 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_getTag.js
4091
4092
4093
4094
4095
4096
4097
4098
4099 /** `Object#toString` result references. */
4100 var mapTag = '[object Map]',
4101 objectTag = '[object Object]',
4102 promiseTag = '[object Promise]',
4103 setTag = '[object Set]',
4104 weakMapTag = '[object WeakMap]';
4105
4106 var dataViewTag = '[object DataView]';
4107
4108 /** Used to detect maps, sets, and weakmaps. */
4109 var dataViewCtorString = (0,_toSource/* default */.Z)(_DataView),
4110 mapCtorString = (0,_toSource/* default */.Z)(_Map/* default */.Z),
4111 promiseCtorString = (0,_toSource/* default */.Z)(_Promise),
4112 setCtorString = (0,_toSource/* default */.Z)(_Set/* default */.Z),
4113 weakMapCtorString = (0,_toSource/* default */.Z)(_WeakMap);
4114
4115 /**
4116 * Gets the `toStringTag` of `value`.
4117 *
4118 * @private
4119 * @param {*} value The value to query.
4120 * @returns {string} Returns the `toStringTag`.
4121 */
4122 var getTag = _baseGetTag/* default */.Z;
4123
4124 // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
4125 if ((_DataView && getTag(new _DataView(new ArrayBuffer(1))) != dataViewTag) ||
4126 (_Map/* default */.Z && getTag(new _Map/* default */.Z) != mapTag) ||
4127 (_Promise && getTag(_Promise.resolve()) != promiseTag) ||
4128 (_Set/* default */.Z && getTag(new _Set/* default */.Z) != setTag) ||
4129 (_WeakMap && getTag(new _WeakMap) != weakMapTag)) {
4130 getTag = function(value) {
4131 var result = (0,_baseGetTag/* default */.Z)(value),
4132 Ctor = result == objectTag ? value.constructor : undefined,
4133 ctorString = Ctor ? (0,_toSource/* default */.Z)(Ctor) : '';
4134
4135 if (ctorString) {
4136 switch (ctorString) {
4137 case dataViewCtorString: return dataViewTag;
4138 case mapCtorString: return mapTag;
4139 case promiseCtorString: return promiseTag;
4140 case setCtorString: return setTag;
4141 case weakMapCtorString: return weakMapTag;
4142 }
4143 }
4144 return result;
4145 };
4146 }
4147
4148 /* harmony default export */ const _getTag = (getTag);
4149
4150
4151 /***/ }),
4152
4153 /***/ 95764:
4154 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4155
4156 "use strict";
4157
4158 // EXPORTS
4159 __webpack_require__.d(__webpack_exports__, {
4160 Z: () => (/* binding */ _initCloneObject)
4161 });
4162
4163 // EXTERNAL MODULE: ../node_modules/lodash-es/isObject.js
4164 var isObject = __webpack_require__(60417);
4165 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_baseCreate.js
4166
4167
4168 /** Built-in value references. */
4169 var objectCreate = Object.create;
4170
4171 /**
4172 * The base implementation of `_.create` without support for assigning
4173 * properties to the created object.
4174 *
4175 * @private
4176 * @param {Object} proto The object to inherit from.
4177 * @returns {Object} Returns the new object.
4178 */
4179 var baseCreate = (function() {
4180 function object() {}
4181 return function(proto) {
4182 if (!(0,isObject/* default */.Z)(proto)) {
4183 return {};
4184 }
4185 if (objectCreate) {
4186 return objectCreate(proto);
4187 }
4188 object.prototype = proto;
4189 var result = new object;
4190 object.prototype = undefined;
4191 return result;
4192 };
4193 }());
4194
4195 /* harmony default export */ const _baseCreate = (baseCreate);
4196
4197 // EXTERNAL MODULE: ../node_modules/lodash-es/_getPrototype.js
4198 var _getPrototype = __webpack_require__(72784);
4199 // EXTERNAL MODULE: ../node_modules/lodash-es/_isPrototype.js
4200 var _isPrototype = __webpack_require__(89418);
4201 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_initCloneObject.js
4202
4203
4204
4205
4206 /**
4207 * Initializes an object clone.
4208 *
4209 * @private
4210 * @param {Object} object The object to clone.
4211 * @returns {Object} Returns the initialized clone.
4212 */
4213 function initCloneObject(object) {
4214 return (typeof object.constructor == 'function' && !(0,_isPrototype/* default */.Z)(object))
4215 ? _baseCreate((0,_getPrototype/* default */.Z)(object))
4216 : {};
4217 }
4218
4219 /* harmony default export */ const _initCloneObject = (initCloneObject);
4220
4221
4222 /***/ }),
4223
4224 /***/ 8616:
4225 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4226
4227 "use strict";
4228 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4229 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
4230 /* harmony export */ });
4231 /** Used as references for various `Number` constants. */
4232 var MAX_SAFE_INTEGER = 9007199254740991;
4233
4234 /** Used to detect unsigned integer values. */
4235 var reIsUint = /^(?:0|[1-9]\d*)$/;
4236
4237 /**
4238 * Checks if `value` is a valid array-like index.
4239 *
4240 * @private
4241 * @param {*} value The value to check.
4242 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
4243 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
4244 */
4245 function isIndex(value, length) {
4246 var type = typeof value;
4247 length = length == null ? MAX_SAFE_INTEGER : length;
4248
4249 return !!length &&
4250 (type == 'number' ||
4251 (type != 'symbol' && reIsUint.test(value))) &&
4252 (value > -1 && value % 1 == 0 && value < length);
4253 }
4254
4255 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isIndex);
4256
4257
4258 /***/ }),
4259
4260 /***/ 47952:
4261 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4262
4263 "use strict";
4264 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4265 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
4266 /* harmony export */ });
4267 /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(35050);
4268 /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(69959);
4269 /* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8616);
4270 /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(60417);
4271
4272
4273
4274
4275
4276 /**
4277 * Checks if the given arguments are from an iteratee call.
4278 *
4279 * @private
4280 * @param {*} value The potential iteratee value argument.
4281 * @param {*} index The potential iteratee index or key argument.
4282 * @param {*} object The potential iteratee object argument.
4283 * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
4284 * else `false`.
4285 */
4286 function isIterateeCall(value, index, object) {
4287 if (!(0,_isObject_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(object)) {
4288 return false;
4289 }
4290 var type = typeof index;
4291 if (type == 'number'
4292 ? ((0,_isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(object) && (0,_isIndex_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)(index, object.length))
4293 : (type == 'string' && index in object)
4294 ) {
4295 return (0,_eq_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z)(object[index], value);
4296 }
4297 return false;
4298 }
4299
4300 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isIterateeCall);
4301
4302
4303 /***/ }),
4304
4305 /***/ 89418:
4306 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4307
4308 "use strict";
4309 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4310 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
4311 /* harmony export */ });
4312 /** Used for built-in method references. */
4313 var objectProto = Object.prototype;
4314
4315 /**
4316 * Checks if `value` is likely a prototype object.
4317 *
4318 * @private
4319 * @param {*} value The value to check.
4320 * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
4321 */
4322 function isPrototype(value) {
4323 var Ctor = value && value.constructor,
4324 proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
4325
4326 return value === proto;
4327 }
4328
4329 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isPrototype);
4330
4331
4332 /***/ }),
4333
4334 /***/ 53594:
4335 /***/ ((module, __webpack_exports__, __webpack_require__) => {
4336
4337 "use strict";
4338 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4339 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
4340 /* harmony export */ });
4341 /* harmony import */ var _freeGlobal_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(89268);
4342 /* module decorator */ module = __webpack_require__.hmd(module);
4343
4344
4345 /** Detect free variable `exports`. */
4346 var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
4347
4348 /** Detect free variable `module`. */
4349 var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
4350
4351 /** Detect the popular CommonJS extension `module.exports`. */
4352 var moduleExports = freeModule && freeModule.exports === freeExports;
4353
4354 /** Detect free variable `process` from Node.js. */
4355 var freeProcess = moduleExports && _freeGlobal_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.process;
4356
4357 /** Used to access faster Node.js helpers. */
4358 var nodeUtil = (function() {
4359 try {
4360 // Use `util.types` for Node.js 10+.
4361 var types = freeModule && freeModule.require && freeModule.require('util').types;
4362
4363 if (types) {
4364 return types;
4365 }
4366
4367 // Legacy `process.binding('util')` for Node.js < 10.
4368 return freeProcess && freeProcess.binding && freeProcess.binding('util');
4369 } catch (e) {}
4370 }());
4371
4372 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (nodeUtil);
4373
4374
4375 /***/ }),
4376
4377 /***/ 4883:
4378 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4379
4380 "use strict";
4381 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4382 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
4383 /* harmony export */ });
4384 /**
4385 * Creates a unary function that invokes `func` with its argument transformed.
4386 *
4387 * @private
4388 * @param {Function} func The function to wrap.
4389 * @param {Function} transform The argument transform.
4390 * @returns {Function} Returns the new function.
4391 */
4392 function overArg(func, transform) {
4393 return function(arg) {
4394 return func(transform(arg));
4395 };
4396 }
4397
4398 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (overArg);
4399
4400
4401 /***/ }),
4402
4403 /***/ 15829:
4404 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4405
4406 "use strict";
4407
4408 // EXPORTS
4409 __webpack_require__.d(__webpack_exports__, {
4410 Z: () => (/* binding */ _overRest)
4411 });
4412
4413 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_apply.js
4414 /**
4415 * A faster alternative to `Function#apply`, this function invokes `func`
4416 * with the `this` binding of `thisArg` and the arguments of `args`.
4417 *
4418 * @private
4419 * @param {Function} func The function to invoke.
4420 * @param {*} thisArg The `this` binding of `func`.
4421 * @param {Array} args The arguments to invoke `func` with.
4422 * @returns {*} Returns the result of `func`.
4423 */
4424 function apply(func, thisArg, args) {
4425 switch (args.length) {
4426 case 0: return func.call(thisArg);
4427 case 1: return func.call(thisArg, args[0]);
4428 case 2: return func.call(thisArg, args[0], args[1]);
4429 case 3: return func.call(thisArg, args[0], args[1], args[2]);
4430 }
4431 return func.apply(thisArg, args);
4432 }
4433
4434 /* harmony default export */ const _apply = (apply);
4435
4436 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_overRest.js
4437
4438
4439 /* Built-in method references for those with the same name as other `lodash` methods. */
4440 var nativeMax = Math.max;
4441
4442 /**
4443 * A specialized version of `baseRest` which transforms the rest array.
4444 *
4445 * @private
4446 * @param {Function} func The function to apply a rest parameter to.
4447 * @param {number} [start=func.length-1] The start position of the rest parameter.
4448 * @param {Function} transform The rest array transform.
4449 * @returns {Function} Returns the new function.
4450 */
4451 function overRest(func, start, transform) {
4452 start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
4453 return function() {
4454 var args = arguments,
4455 index = -1,
4456 length = nativeMax(args.length - start, 0),
4457 array = Array(length);
4458
4459 while (++index < length) {
4460 array[index] = args[start + index];
4461 }
4462 index = -1;
4463 var otherArgs = Array(start + 1);
4464 while (++index < start) {
4465 otherArgs[index] = args[index];
4466 }
4467 otherArgs[start] = transform(array);
4468 return _apply(func, this, otherArgs);
4469 };
4470 }
4471
4472 /* harmony default export */ const _overRest = (overRest);
4473
4474
4475 /***/ }),
4476
4477 /***/ 94311:
4478 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4479
4480 "use strict";
4481 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4482 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
4483 /* harmony export */ });
4484 /* harmony import */ var _freeGlobal_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(89268);
4485
4486
4487 /** Detect free variable `self`. */
4488 var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
4489
4490 /** Used as a reference to the global object. */
4491 var root = _freeGlobal_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z || freeSelf || Function('return this')();
4492
4493 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (root);
4494
4495
4496 /***/ }),
4497
4498 /***/ 71649:
4499 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4500
4501 "use strict";
4502
4503 // EXPORTS
4504 __webpack_require__.d(__webpack_exports__, {
4505 Z: () => (/* binding */ _setToString)
4506 });
4507
4508 // EXTERNAL MODULE: ../node_modules/lodash-es/constant.js
4509 var constant = __webpack_require__(78795);
4510 // EXTERNAL MODULE: ../node_modules/lodash-es/_defineProperty.js
4511 var _defineProperty = __webpack_require__(30253);
4512 // EXTERNAL MODULE: ../node_modules/lodash-es/identity.js
4513 var identity = __webpack_require__(64056);
4514 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_baseSetToString.js
4515
4516
4517
4518
4519 /**
4520 * The base implementation of `setToString` without support for hot loop shorting.
4521 *
4522 * @private
4523 * @param {Function} func The function to modify.
4524 * @param {Function} string The `toString` result.
4525 * @returns {Function} Returns `func`.
4526 */
4527 var baseSetToString = !_defineProperty/* default */.Z ? identity/* default */.Z : function(func, string) {
4528 return (0,_defineProperty/* default */.Z)(func, 'toString', {
4529 'configurable': true,
4530 'enumerable': false,
4531 'value': (0,constant/* default */.Z)(string),
4532 'writable': true
4533 });
4534 };
4535
4536 /* harmony default export */ const _baseSetToString = (baseSetToString);
4537
4538 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_shortOut.js
4539 /** Used to detect hot functions by number of calls within a span of milliseconds. */
4540 var HOT_COUNT = 800,
4541 HOT_SPAN = 16;
4542
4543 /* Built-in method references for those with the same name as other `lodash` methods. */
4544 var nativeNow = Date.now;
4545
4546 /**
4547 * Creates a function that'll short out and invoke `identity` instead
4548 * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
4549 * milliseconds.
4550 *
4551 * @private
4552 * @param {Function} func The function to restrict.
4553 * @returns {Function} Returns the new shortable function.
4554 */
4555 function shortOut(func) {
4556 var count = 0,
4557 lastCalled = 0;
4558
4559 return function() {
4560 var stamp = nativeNow(),
4561 remaining = HOT_SPAN - (stamp - lastCalled);
4562
4563 lastCalled = stamp;
4564 if (remaining > 0) {
4565 if (++count >= HOT_COUNT) {
4566 return arguments[0];
4567 }
4568 } else {
4569 count = 0;
4570 }
4571 return func.apply(undefined, arguments);
4572 };
4573 }
4574
4575 /* harmony default export */ const _shortOut = (shortOut);
4576
4577 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_setToString.js
4578
4579
4580
4581 /**
4582 * Sets the `toString` method of `func` to return `string`.
4583 *
4584 * @private
4585 * @param {Function} func The function to modify.
4586 * @param {Function} string The `toString` result.
4587 * @returns {Function} Returns `func`.
4588 */
4589 var setToString = _shortOut(_baseSetToString);
4590
4591 /* harmony default export */ const _setToString = (setToString);
4592
4593
4594 /***/ }),
4595
4596 /***/ 62392:
4597 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4598
4599 "use strict";
4600 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4601 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
4602 /* harmony export */ });
4603 /** Used for built-in method references. */
4604 var funcProto = Function.prototype;
4605
4606 /** Used to resolve the decompiled source of functions. */
4607 var funcToString = funcProto.toString;
4608
4609 /**
4610 * Converts `func` to its source code.
4611 *
4612 * @private
4613 * @param {Function} func The function to convert.
4614 * @returns {string} Returns the source code.
4615 */
4616 function toSource(func) {
4617 if (func != null) {
4618 try {
4619 return funcToString.call(func);
4620 } catch (e) {}
4621 try {
4622 return (func + '');
4623 } catch (e) {}
4624 }
4625 return '';
4626 }
4627
4628 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (toSource);
4629
4630
4631 /***/ }),
4632
4633 /***/ 78795:
4634 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4635
4636 "use strict";
4637 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4638 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
4639 /* harmony export */ });
4640 /**
4641 * Creates a function that returns `value`.
4642 *
4643 * @static
4644 * @memberOf _
4645 * @since 2.4.0
4646 * @category Util
4647 * @param {*} value The value to return from the new function.
4648 * @returns {Function} Returns the new constant function.
4649 * @example
4650 *
4651 * var objects = _.times(2, _.constant({ 'a': 1 }));
4652 *
4653 * console.log(objects);
4654 * // => [{ 'a': 1 }, { 'a': 1 }]
4655 *
4656 * console.log(objects[0] === objects[1]);
4657 * // => true
4658 */
4659 function constant(value) {
4660 return function() {
4661 return value;
4662 };
4663 }
4664
4665 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (constant);
4666
4667
4668 /***/ }),
4669
4670 /***/ 35050:
4671 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4672
4673 "use strict";
4674 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4675 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
4676 /* harmony export */ });
4677 /**
4678 * Performs a
4679 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
4680 * comparison between two values to determine if they are equivalent.
4681 *
4682 * @static
4683 * @memberOf _
4684 * @since 4.0.0
4685 * @category Lang
4686 * @param {*} value The value to compare.
4687 * @param {*} other The other value to compare.
4688 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
4689 * @example
4690 *
4691 * var object = { 'a': 1 };
4692 * var other = { 'a': 1 };
4693 *
4694 * _.eq(object, object);
4695 * // => true
4696 *
4697 * _.eq(object, other);
4698 * // => false
4699 *
4700 * _.eq('a', 'a');
4701 * // => true
4702 *
4703 * _.eq('a', Object('a'));
4704 * // => false
4705 *
4706 * _.eq(NaN, NaN);
4707 * // => true
4708 */
4709 function eq(value, other) {
4710 return value === other || (value !== value && other !== other);
4711 }
4712
4713 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (eq);
4714
4715
4716 /***/ }),
4717
4718 /***/ 64056:
4719 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4720
4721 "use strict";
4722 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4723 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
4724 /* harmony export */ });
4725 /**
4726 * This method returns the first argument it receives.
4727 *
4728 * @static
4729 * @since 0.1.0
4730 * @memberOf _
4731 * @category Util
4732 * @param {*} value Any value.
4733 * @returns {*} Returns `value`.
4734 * @example
4735 *
4736 * var object = { 'a': 1 };
4737 *
4738 * console.log(_.identity(object) === object);
4739 * // => true
4740 */
4741 function identity(value) {
4742 return value;
4743 }
4744
4745 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (identity);
4746
4747
4748 /***/ }),
4749
4750 /***/ 9028:
4751 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4752
4753 "use strict";
4754
4755 // EXPORTS
4756 __webpack_require__.d(__webpack_exports__, {
4757 Z: () => (/* binding */ lodash_es_isArguments)
4758 });
4759
4760 // EXTERNAL MODULE: ../node_modules/lodash-es/_baseGetTag.js + 2 modules
4761 var _baseGetTag = __webpack_require__(77070);
4762 // EXTERNAL MODULE: ../node_modules/lodash-es/isObjectLike.js
4763 var isObjectLike = __webpack_require__(9615);
4764 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_baseIsArguments.js
4765
4766
4767
4768 /** `Object#toString` result references. */
4769 var argsTag = '[object Arguments]';
4770
4771 /**
4772 * The base implementation of `_.isArguments`.
4773 *
4774 * @private
4775 * @param {*} value The value to check.
4776 * @returns {boolean} Returns `true` if `value` is an `arguments` object,
4777 */
4778 function baseIsArguments(value) {
4779 return (0,isObjectLike/* default */.Z)(value) && (0,_baseGetTag/* default */.Z)(value) == argsTag;
4780 }
4781
4782 /* harmony default export */ const _baseIsArguments = (baseIsArguments);
4783
4784 ;// CONCATENATED MODULE: ../node_modules/lodash-es/isArguments.js
4785
4786
4787
4788 /** Used for built-in method references. */
4789 var objectProto = Object.prototype;
4790
4791 /** Used to check objects for own properties. */
4792 var isArguments_hasOwnProperty = objectProto.hasOwnProperty;
4793
4794 /** Built-in value references. */
4795 var propertyIsEnumerable = objectProto.propertyIsEnumerable;
4796
4797 /**
4798 * Checks if `value` is likely an `arguments` object.
4799 *
4800 * @static
4801 * @memberOf _
4802 * @since 0.1.0
4803 * @category Lang
4804 * @param {*} value The value to check.
4805 * @returns {boolean} Returns `true` if `value` is an `arguments` object,
4806 * else `false`.
4807 * @example
4808 *
4809 * _.isArguments(function() { return arguments; }());
4810 * // => true
4811 *
4812 * _.isArguments([1, 2, 3]);
4813 * // => false
4814 */
4815 var isArguments = _baseIsArguments(function() { return arguments; }()) ? _baseIsArguments : function(value) {
4816 return (0,isObjectLike/* default */.Z)(value) && isArguments_hasOwnProperty.call(value, 'callee') &&
4817 !propertyIsEnumerable.call(value, 'callee');
4818 };
4819
4820 /* harmony default export */ const lodash_es_isArguments = (isArguments);
4821
4822
4823 /***/ }),
4824
4825 /***/ 64058:
4826 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4827
4828 "use strict";
4829 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4830 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
4831 /* harmony export */ });
4832 /**
4833 * Checks if `value` is classified as an `Array` object.
4834 *
4835 * @static
4836 * @memberOf _
4837 * @since 0.1.0
4838 * @category Lang
4839 * @param {*} value The value to check.
4840 * @returns {boolean} Returns `true` if `value` is an array, else `false`.
4841 * @example
4842 *
4843 * _.isArray([1, 2, 3]);
4844 * // => true
4845 *
4846 * _.isArray(document.body.children);
4847 * // => false
4848 *
4849 * _.isArray('abc');
4850 * // => false
4851 *
4852 * _.isArray(_.noop);
4853 * // => false
4854 */
4855 var isArray = Array.isArray;
4856
4857 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isArray);
4858
4859
4860 /***/ }),
4861
4862 /***/ 69959:
4863 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4864
4865 "use strict";
4866 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4867 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
4868 /* harmony export */ });
4869 /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(48489);
4870 /* harmony import */ var _isLength_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(30918);
4871
4872
4873
4874 /**
4875 * Checks if `value` is array-like. A value is considered array-like if it's
4876 * not a function and has a `value.length` that's an integer greater than or
4877 * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
4878 *
4879 * @static
4880 * @memberOf _
4881 * @since 4.0.0
4882 * @category Lang
4883 * @param {*} value The value to check.
4884 * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
4885 * @example
4886 *
4887 * _.isArrayLike([1, 2, 3]);
4888 * // => true
4889 *
4890 * _.isArrayLike(document.body.children);
4891 * // => true
4892 *
4893 * _.isArrayLike('abc');
4894 * // => true
4895 *
4896 * _.isArrayLike(_.noop);
4897 * // => false
4898 */
4899 function isArrayLike(value) {
4900 return value != null && (0,_isLength_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(value.length) && !(0,_isFunction_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(value);
4901 }
4902
4903 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isArrayLike);
4904
4905
4906 /***/ }),
4907
4908 /***/ 60492:
4909 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4910
4911 "use strict";
4912 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4913 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
4914 /* harmony export */ });
4915 /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(69959);
4916 /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9615);
4917
4918
4919
4920 /**
4921 * This method is like `_.isArrayLike` except that it also checks if `value`
4922 * is an object.
4923 *
4924 * @static
4925 * @memberOf _
4926 * @since 4.0.0
4927 * @category Lang
4928 * @param {*} value The value to check.
4929 * @returns {boolean} Returns `true` if `value` is an array-like object,
4930 * else `false`.
4931 * @example
4932 *
4933 * _.isArrayLikeObject([1, 2, 3]);
4934 * // => true
4935 *
4936 * _.isArrayLikeObject(document.body.children);
4937 * // => true
4938 *
4939 * _.isArrayLikeObject('abc');
4940 * // => false
4941 *
4942 * _.isArrayLikeObject(_.noop);
4943 * // => false
4944 */
4945 function isArrayLikeObject(value) {
4946 return (0,_isObjectLike_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(value) && (0,_isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(value);
4947 }
4948
4949 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isArrayLikeObject);
4950
4951
4952 /***/ }),
4953
4954 /***/ 23230:
4955 /***/ ((module, __webpack_exports__, __webpack_require__) => {
4956
4957 "use strict";
4958
4959 // EXPORTS
4960 __webpack_require__.d(__webpack_exports__, {
4961 Z: () => (/* binding */ lodash_es_isBuffer)
4962 });
4963
4964 // EXTERNAL MODULE: ../node_modules/lodash-es/_root.js
4965 var _root = __webpack_require__(94311);
4966 ;// CONCATENATED MODULE: ../node_modules/lodash-es/stubFalse.js
4967 /**
4968 * This method returns `false`.
4969 *
4970 * @static
4971 * @memberOf _
4972 * @since 4.13.0
4973 * @category Util
4974 * @returns {boolean} Returns `false`.
4975 * @example
4976 *
4977 * _.times(2, _.stubFalse);
4978 * // => [false, false]
4979 */
4980 function stubFalse() {
4981 return false;
4982 }
4983
4984 /* harmony default export */ const lodash_es_stubFalse = (stubFalse);
4985
4986 ;// CONCATENATED MODULE: ../node_modules/lodash-es/isBuffer.js
4987 /* module decorator */ module = __webpack_require__.hmd(module);
4988
4989
4990
4991 /** Detect free variable `exports`. */
4992 var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
4993
4994 /** Detect free variable `module`. */
4995 var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
4996
4997 /** Detect the popular CommonJS extension `module.exports`. */
4998 var moduleExports = freeModule && freeModule.exports === freeExports;
4999
5000 /** Built-in value references. */
5001 var Buffer = moduleExports ? _root/* default */.Z.Buffer : undefined;
5002
5003 /* Built-in method references for those with the same name as other `lodash` methods. */
5004 var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
5005
5006 /**
5007 * Checks if `value` is a buffer.
5008 *
5009 * @static
5010 * @memberOf _
5011 * @since 4.3.0
5012 * @category Lang
5013 * @param {*} value The value to check.
5014 * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
5015 * @example
5016 *
5017 * _.isBuffer(new Buffer(2));
5018 * // => true
5019 *
5020 * _.isBuffer(new Uint8Array(2));
5021 * // => false
5022 */
5023 var isBuffer = nativeIsBuffer || lodash_es_stubFalse;
5024
5025 /* harmony default export */ const lodash_es_isBuffer = (isBuffer);
5026
5027
5028 /***/ }),
5029
5030 /***/ 66400:
5031 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5032
5033 "use strict";
5034 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5035 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
5036 /* harmony export */ });
5037 /* harmony import */ var _baseKeys_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(45934);
5038 /* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(41182);
5039 /* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9028);
5040 /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(64058);
5041 /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69959);
5042 /* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23230);
5043 /* harmony import */ var _isPrototype_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(89418);
5044 /* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(14923);
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054 /** `Object#toString` result references. */
5055 var mapTag = '[object Map]',
5056 setTag = '[object Set]';
5057
5058 /** Used for built-in method references. */
5059 var objectProto = Object.prototype;
5060
5061 /** Used to check objects for own properties. */
5062 var hasOwnProperty = objectProto.hasOwnProperty;
5063
5064 /**
5065 * Checks if `value` is an empty object, collection, map, or set.
5066 *
5067 * Objects are considered empty if they have no own enumerable string keyed
5068 * properties.
5069 *
5070 * Array-like values such as `arguments` objects, arrays, buffers, strings, or
5071 * jQuery-like collections are considered empty if they have a `length` of `0`.
5072 * Similarly, maps and sets are considered empty if they have a `size` of `0`.
5073 *
5074 * @static
5075 * @memberOf _
5076 * @since 0.1.0
5077 * @category Lang
5078 * @param {*} value The value to check.
5079 * @returns {boolean} Returns `true` if `value` is empty, else `false`.
5080 * @example
5081 *
5082 * _.isEmpty(null);
5083 * // => true
5084 *
5085 * _.isEmpty(true);
5086 * // => true
5087 *
5088 * _.isEmpty(1);
5089 * // => true
5090 *
5091 * _.isEmpty([1, 2, 3]);
5092 * // => false
5093 *
5094 * _.isEmpty({ 'a': 1 });
5095 * // => false
5096 */
5097 function isEmpty(value) {
5098 if (value == null) {
5099 return true;
5100 }
5101 if ((0,_isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(value) &&
5102 ((0,_isArray_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(value) || typeof value == 'string' || typeof value.splice == 'function' ||
5103 (0,_isBuffer_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)(value) || (0,_isTypedArray_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z)(value) || (0,_isArguments_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(value))) {
5104 return !value.length;
5105 }
5106 var tag = (0,_getTag_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z)(value);
5107 if (tag == mapTag || tag == setTag) {
5108 return !value.size;
5109 }
5110 if ((0,_isPrototype_js__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z)(value)) {
5111 return !(0,_baseKeys_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z)(value).length;
5112 }
5113 for (var key in value) {
5114 if (hasOwnProperty.call(value, key)) {
5115 return false;
5116 }
5117 }
5118 return true;
5119 }
5120
5121 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isEmpty);
5122
5123
5124 /***/ }),
5125
5126 /***/ 48489:
5127 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5128
5129 "use strict";
5130 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5131 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
5132 /* harmony export */ });
5133 /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(77070);
5134 /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(60417);
5135
5136
5137
5138 /** `Object#toString` result references. */
5139 var asyncTag = '[object AsyncFunction]',
5140 funcTag = '[object Function]',
5141 genTag = '[object GeneratorFunction]',
5142 proxyTag = '[object Proxy]';
5143
5144 /**
5145 * Checks if `value` is classified as a `Function` object.
5146 *
5147 * @static
5148 * @memberOf _
5149 * @since 0.1.0
5150 * @category Lang
5151 * @param {*} value The value to check.
5152 * @returns {boolean} Returns `true` if `value` is a function, else `false`.
5153 * @example
5154 *
5155 * _.isFunction(_);
5156 * // => true
5157 *
5158 * _.isFunction(/abc/);
5159 * // => false
5160 */
5161 function isFunction(value) {
5162 if (!(0,_isObject_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(value)) {
5163 return false;
5164 }
5165 // The use of `Object#toString` avoids issues with the `typeof` operator
5166 // in Safari 9 which returns 'object' for typed arrays and other constructors.
5167 var tag = (0,_baseGetTag_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(value);
5168 return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
5169 }
5170
5171 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isFunction);
5172
5173
5174 /***/ }),
5175
5176 /***/ 30918:
5177 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5178
5179 "use strict";
5180 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5181 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
5182 /* harmony export */ });
5183 /** Used as references for various `Number` constants. */
5184 var MAX_SAFE_INTEGER = 9007199254740991;
5185
5186 /**
5187 * Checks if `value` is a valid array-like length.
5188 *
5189 * **Note:** This method is loosely based on
5190 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
5191 *
5192 * @static
5193 * @memberOf _
5194 * @since 4.0.0
5195 * @category Lang
5196 * @param {*} value The value to check.
5197 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
5198 * @example
5199 *
5200 * _.isLength(3);
5201 * // => true
5202 *
5203 * _.isLength(Number.MIN_VALUE);
5204 * // => false
5205 *
5206 * _.isLength(Infinity);
5207 * // => false
5208 *
5209 * _.isLength('3');
5210 * // => false
5211 */
5212 function isLength(value) {
5213 return typeof value == 'number' &&
5214 value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
5215 }
5216
5217 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isLength);
5218
5219
5220 /***/ }),
5221
5222 /***/ 60417:
5223 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5224
5225 "use strict";
5226 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5227 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
5228 /* harmony export */ });
5229 /**
5230 * Checks if `value` is the
5231 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
5232 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
5233 *
5234 * @static
5235 * @memberOf _
5236 * @since 0.1.0
5237 * @category Lang
5238 * @param {*} value The value to check.
5239 * @returns {boolean} Returns `true` if `value` is an object, else `false`.
5240 * @example
5241 *
5242 * _.isObject({});
5243 * // => true
5244 *
5245 * _.isObject([1, 2, 3]);
5246 * // => true
5247 *
5248 * _.isObject(_.noop);
5249 * // => true
5250 *
5251 * _.isObject(null);
5252 * // => false
5253 */
5254 function isObject(value) {
5255 var type = typeof value;
5256 return value != null && (type == 'object' || type == 'function');
5257 }
5258
5259 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isObject);
5260
5261
5262 /***/ }),
5263
5264 /***/ 9615:
5265 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5266
5267 "use strict";
5268 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5269 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
5270 /* harmony export */ });
5271 /**
5272 * Checks if `value` is object-like. A value is object-like if it's not `null`
5273 * and has a `typeof` result of "object".
5274 *
5275 * @static
5276 * @memberOf _
5277 * @since 4.0.0
5278 * @category Lang
5279 * @param {*} value The value to check.
5280 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
5281 * @example
5282 *
5283 * _.isObjectLike({});
5284 * // => true
5285 *
5286 * _.isObjectLike([1, 2, 3]);
5287 * // => true
5288 *
5289 * _.isObjectLike(_.noop);
5290 * // => false
5291 *
5292 * _.isObjectLike(null);
5293 * // => false
5294 */
5295 function isObjectLike(value) {
5296 return value != null && typeof value == 'object';
5297 }
5298
5299 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isObjectLike);
5300
5301
5302 /***/ }),
5303
5304 /***/ 14923:
5305 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5306
5307 "use strict";
5308
5309 // EXPORTS
5310 __webpack_require__.d(__webpack_exports__, {
5311 Z: () => (/* binding */ lodash_es_isTypedArray)
5312 });
5313
5314 // EXTERNAL MODULE: ../node_modules/lodash-es/_baseGetTag.js + 2 modules
5315 var _baseGetTag = __webpack_require__(77070);
5316 // EXTERNAL MODULE: ../node_modules/lodash-es/isLength.js
5317 var isLength = __webpack_require__(30918);
5318 // EXTERNAL MODULE: ../node_modules/lodash-es/isObjectLike.js
5319 var isObjectLike = __webpack_require__(9615);
5320 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_baseIsTypedArray.js
5321
5322
5323
5324
5325 /** `Object#toString` result references. */
5326 var argsTag = '[object Arguments]',
5327 arrayTag = '[object Array]',
5328 boolTag = '[object Boolean]',
5329 dateTag = '[object Date]',
5330 errorTag = '[object Error]',
5331 funcTag = '[object Function]',
5332 mapTag = '[object Map]',
5333 numberTag = '[object Number]',
5334 objectTag = '[object Object]',
5335 regexpTag = '[object RegExp]',
5336 setTag = '[object Set]',
5337 stringTag = '[object String]',
5338 weakMapTag = '[object WeakMap]';
5339
5340 var arrayBufferTag = '[object ArrayBuffer]',
5341 dataViewTag = '[object DataView]',
5342 float32Tag = '[object Float32Array]',
5343 float64Tag = '[object Float64Array]',
5344 int8Tag = '[object Int8Array]',
5345 int16Tag = '[object Int16Array]',
5346 int32Tag = '[object Int32Array]',
5347 uint8Tag = '[object Uint8Array]',
5348 uint8ClampedTag = '[object Uint8ClampedArray]',
5349 uint16Tag = '[object Uint16Array]',
5350 uint32Tag = '[object Uint32Array]';
5351
5352 /** Used to identify `toStringTag` values of typed arrays. */
5353 var typedArrayTags = {};
5354 typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
5355 typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
5356 typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
5357 typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
5358 typedArrayTags[uint32Tag] = true;
5359 typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
5360 typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
5361 typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
5362 typedArrayTags[errorTag] = typedArrayTags[funcTag] =
5363 typedArrayTags[mapTag] = typedArrayTags[numberTag] =
5364 typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
5365 typedArrayTags[setTag] = typedArrayTags[stringTag] =
5366 typedArrayTags[weakMapTag] = false;
5367
5368 /**
5369 * The base implementation of `_.isTypedArray` without Node.js optimizations.
5370 *
5371 * @private
5372 * @param {*} value The value to check.
5373 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
5374 */
5375 function baseIsTypedArray(value) {
5376 return (0,isObjectLike/* default */.Z)(value) &&
5377 (0,isLength/* default */.Z)(value.length) && !!typedArrayTags[(0,_baseGetTag/* default */.Z)(value)];
5378 }
5379
5380 /* harmony default export */ const _baseIsTypedArray = (baseIsTypedArray);
5381
5382 // EXTERNAL MODULE: ../node_modules/lodash-es/_baseUnary.js
5383 var _baseUnary = __webpack_require__(20274);
5384 // EXTERNAL MODULE: ../node_modules/lodash-es/_nodeUtil.js
5385 var _nodeUtil = __webpack_require__(53594);
5386 ;// CONCATENATED MODULE: ../node_modules/lodash-es/isTypedArray.js
5387
5388
5389
5390
5391 /* Node.js helper references. */
5392 var nodeIsTypedArray = _nodeUtil/* default */.Z && _nodeUtil/* default */.Z.isTypedArray;
5393
5394 /**
5395 * Checks if `value` is classified as a typed array.
5396 *
5397 * @static
5398 * @memberOf _
5399 * @since 3.0.0
5400 * @category Lang
5401 * @param {*} value The value to check.
5402 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
5403 * @example
5404 *
5405 * _.isTypedArray(new Uint8Array);
5406 * // => true
5407 *
5408 * _.isTypedArray([]);
5409 * // => false
5410 */
5411 var isTypedArray = nodeIsTypedArray ? (0,_baseUnary/* default */.Z)(nodeIsTypedArray) : _baseIsTypedArray;
5412
5413 /* harmony default export */ const lodash_es_isTypedArray = (isTypedArray);
5414
5415
5416 /***/ }),
5417
5418 /***/ 48441:
5419 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5420
5421 "use strict";
5422
5423 // EXPORTS
5424 __webpack_require__.d(__webpack_exports__, {
5425 Z: () => (/* binding */ lodash_es_keysIn)
5426 });
5427
5428 // EXTERNAL MODULE: ../node_modules/lodash-es/_arrayLikeKeys.js + 1 modules
5429 var _arrayLikeKeys = __webpack_require__(40709);
5430 // EXTERNAL MODULE: ../node_modules/lodash-es/isObject.js
5431 var isObject = __webpack_require__(60417);
5432 // EXTERNAL MODULE: ../node_modules/lodash-es/_isPrototype.js
5433 var _isPrototype = __webpack_require__(89418);
5434 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_nativeKeysIn.js
5435 /**
5436 * This function is like
5437 * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
5438 * except that it includes inherited enumerable properties.
5439 *
5440 * @private
5441 * @param {Object} object The object to query.
5442 * @returns {Array} Returns the array of property names.
5443 */
5444 function nativeKeysIn(object) {
5445 var result = [];
5446 if (object != null) {
5447 for (var key in Object(object)) {
5448 result.push(key);
5449 }
5450 }
5451 return result;
5452 }
5453
5454 /* harmony default export */ const _nativeKeysIn = (nativeKeysIn);
5455
5456 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_baseKeysIn.js
5457
5458
5459
5460
5461 /** Used for built-in method references. */
5462 var objectProto = Object.prototype;
5463
5464 /** Used to check objects for own properties. */
5465 var _baseKeysIn_hasOwnProperty = objectProto.hasOwnProperty;
5466
5467 /**
5468 * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
5469 *
5470 * @private
5471 * @param {Object} object The object to query.
5472 * @returns {Array} Returns the array of property names.
5473 */
5474 function baseKeysIn(object) {
5475 if (!(0,isObject/* default */.Z)(object)) {
5476 return _nativeKeysIn(object);
5477 }
5478 var isProto = (0,_isPrototype/* default */.Z)(object),
5479 result = [];
5480
5481 for (var key in object) {
5482 if (!(key == 'constructor' && (isProto || !_baseKeysIn_hasOwnProperty.call(object, key)))) {
5483 result.push(key);
5484 }
5485 }
5486 return result;
5487 }
5488
5489 /* harmony default export */ const _baseKeysIn = (baseKeysIn);
5490
5491 // EXTERNAL MODULE: ../node_modules/lodash-es/isArrayLike.js
5492 var isArrayLike = __webpack_require__(69959);
5493 ;// CONCATENATED MODULE: ../node_modules/lodash-es/keysIn.js
5494
5495
5496
5497
5498 /**
5499 * Creates an array of the own and inherited enumerable property names of `object`.
5500 *
5501 * **Note:** Non-object values are coerced to objects.
5502 *
5503 * @static
5504 * @memberOf _
5505 * @since 3.0.0
5506 * @category Object
5507 * @param {Object} object The object to query.
5508 * @returns {Array} Returns the array of property names.
5509 * @example
5510 *
5511 * function Foo() {
5512 * this.a = 1;
5513 * this.b = 2;
5514 * }
5515 *
5516 * Foo.prototype.c = 3;
5517 *
5518 * _.keysIn(new Foo);
5519 * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
5520 */
5521 function keysIn(object) {
5522 return (0,isArrayLike/* default */.Z)(object) ? (0,_arrayLikeKeys/* default */.Z)(object, true) : _baseKeysIn(object);
5523 }
5524
5525 /* harmony default export */ const lodash_es_keysIn = (keysIn);
5526
5527
5528 /***/ }),
5529
5530 /***/ 86861:
5531 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5532
5533 "use strict";
5534 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5535 /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
5536 /* harmony export */ });
5537 /* harmony import */ var _MapCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(24395);
5538
5539
5540 /** Error message constants. */
5541 var FUNC_ERROR_TEXT = 'Expected a function';
5542
5543 /**
5544 * Creates a function that memoizes the result of `func`. If `resolver` is
5545 * provided, it determines the cache key for storing the result based on the
5546 * arguments provided to the memoized function. By default, the first argument
5547 * provided to the memoized function is used as the map cache key. The `func`
5548 * is invoked with the `this` binding of the memoized function.
5549 *
5550 * **Note:** The cache is exposed as the `cache` property on the memoized
5551 * function. Its creation may be customized by replacing the `_.memoize.Cache`
5552 * constructor with one whose instances implement the
5553 * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
5554 * method interface of `clear`, `delete`, `get`, `has`, and `set`.
5555 *
5556 * @static
5557 * @memberOf _
5558 * @since 0.1.0
5559 * @category Function
5560 * @param {Function} func The function to have its output memoized.
5561 * @param {Function} [resolver] The function to resolve the cache key.
5562 * @returns {Function} Returns the new memoized function.
5563 * @example
5564 *
5565 * var object = { 'a': 1, 'b': 2 };
5566 * var other = { 'c': 3, 'd': 4 };
5567 *
5568 * var values = _.memoize(_.values);
5569 * values(object);
5570 * // => [1, 2]
5571 *
5572 * values(other);
5573 * // => [3, 4]
5574 *
5575 * object.a = 2;
5576 * values(object);
5577 * // => [1, 2]
5578 *
5579 * // Modify the result cache.
5580 * values.cache.set(object, ['a', 'b']);
5581 * values(object);
5582 * // => ['a', 'b']
5583 *
5584 * // Replace `_.memoize.Cache`.
5585 * _.memoize.Cache = WeakMap;
5586 */
5587 function memoize(func, resolver) {
5588 if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
5589 throw new TypeError(FUNC_ERROR_TEXT);
5590 }
5591 var memoized = function() {
5592 var args = arguments,
5593 key = resolver ? resolver.apply(this, args) : args[0],
5594 cache = memoized.cache;
5595
5596 if (cache.has(key)) {
5597 return cache.get(key);
5598 }
5599 var result = func.apply(this, args);
5600 memoized.cache = cache.set(key, result) || cache;
5601 return result;
5602 };
5603 memoized.cache = new (memoize.Cache || _MapCache_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z);
5604 return memoized;
5605 }
5606
5607 // Expose `MapCache`.
5608 memoize.Cache = _MapCache_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z;
5609
5610 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (memoize);
5611
5612
5613 /***/ }),
5614
5615 /***/ 20895:
5616 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5617
5618 "use strict";
5619
5620 // EXPORTS
5621 __webpack_require__.d(__webpack_exports__, {
5622 Z: () => (/* binding */ lodash_es_merge)
5623 });
5624
5625 // EXTERNAL MODULE: ../node_modules/lodash-es/_Stack.js + 5 modules
5626 var _Stack = __webpack_require__(82948);
5627 // EXTERNAL MODULE: ../node_modules/lodash-es/_baseAssignValue.js
5628 var _baseAssignValue = __webpack_require__(93586);
5629 // EXTERNAL MODULE: ../node_modules/lodash-es/eq.js
5630 var eq = __webpack_require__(35050);
5631 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_assignMergeValue.js
5632
5633
5634
5635 /**
5636 * This function is like `assignValue` except that it doesn't assign
5637 * `undefined` values.
5638 *
5639 * @private
5640 * @param {Object} object The object to modify.
5641 * @param {string} key The key of the property to assign.
5642 * @param {*} value The value to assign.
5643 */
5644 function assignMergeValue(object, key, value) {
5645 if ((value !== undefined && !(0,eq/* default */.Z)(object[key], value)) ||
5646 (value === undefined && !(key in object))) {
5647 (0,_baseAssignValue/* default */.Z)(object, key, value);
5648 }
5649 }
5650
5651 /* harmony default export */ const _assignMergeValue = (assignMergeValue);
5652
5653 // EXTERNAL MODULE: ../node_modules/lodash-es/_baseFor.js + 1 modules
5654 var _baseFor = __webpack_require__(49399);
5655 // EXTERNAL MODULE: ../node_modules/lodash-es/_cloneBuffer.js
5656 var _cloneBuffer = __webpack_require__(64405);
5657 // EXTERNAL MODULE: ../node_modules/lodash-es/_cloneTypedArray.js
5658 var _cloneTypedArray = __webpack_require__(61601);
5659 // EXTERNAL MODULE: ../node_modules/lodash-es/_copyArray.js
5660 var _copyArray = __webpack_require__(93580);
5661 // EXTERNAL MODULE: ../node_modules/lodash-es/_initCloneObject.js + 1 modules
5662 var _initCloneObject = __webpack_require__(95764);
5663 // EXTERNAL MODULE: ../node_modules/lodash-es/isArguments.js + 1 modules
5664 var isArguments = __webpack_require__(9028);
5665 // EXTERNAL MODULE: ../node_modules/lodash-es/isArray.js
5666 var isArray = __webpack_require__(64058);
5667 // EXTERNAL MODULE: ../node_modules/lodash-es/isArrayLikeObject.js
5668 var isArrayLikeObject = __webpack_require__(60492);
5669 // EXTERNAL MODULE: ../node_modules/lodash-es/isBuffer.js + 1 modules
5670 var isBuffer = __webpack_require__(23230);
5671 // EXTERNAL MODULE: ../node_modules/lodash-es/isFunction.js
5672 var isFunction = __webpack_require__(48489);
5673 // EXTERNAL MODULE: ../node_modules/lodash-es/isObject.js
5674 var isObject = __webpack_require__(60417);
5675 // EXTERNAL MODULE: ../node_modules/lodash-es/_baseGetTag.js + 2 modules
5676 var _baseGetTag = __webpack_require__(77070);
5677 // EXTERNAL MODULE: ../node_modules/lodash-es/_getPrototype.js
5678 var _getPrototype = __webpack_require__(72784);
5679 // EXTERNAL MODULE: ../node_modules/lodash-es/isObjectLike.js
5680 var isObjectLike = __webpack_require__(9615);
5681 ;// CONCATENATED MODULE: ../node_modules/lodash-es/isPlainObject.js
5682
5683
5684
5685
5686 /** `Object#toString` result references. */
5687 var objectTag = '[object Object]';
5688
5689 /** Used for built-in method references. */
5690 var funcProto = Function.prototype,
5691 objectProto = Object.prototype;
5692
5693 /** Used to resolve the decompiled source of functions. */
5694 var funcToString = funcProto.toString;
5695
5696 /** Used to check objects for own properties. */
5697 var isPlainObject_hasOwnProperty = objectProto.hasOwnProperty;
5698
5699 /** Used to infer the `Object` constructor. */
5700 var objectCtorString = funcToString.call(Object);
5701
5702 /**
5703 * Checks if `value` is a plain object, that is, an object created by the
5704 * `Object` constructor or one with a `[[Prototype]]` of `null`.
5705 *
5706 * @static
5707 * @memberOf _
5708 * @since 0.8.0
5709 * @category Lang
5710 * @param {*} value The value to check.
5711 * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
5712 * @example
5713 *
5714 * function Foo() {
5715 * this.a = 1;
5716 * }
5717 *
5718 * _.isPlainObject(new Foo);
5719 * // => false
5720 *
5721 * _.isPlainObject([1, 2, 3]);
5722 * // => false
5723 *
5724 * _.isPlainObject({ 'x': 0, 'y': 0 });
5725 * // => true
5726 *
5727 * _.isPlainObject(Object.create(null));
5728 * // => true
5729 */
5730 function isPlainObject(value) {
5731 if (!(0,isObjectLike/* default */.Z)(value) || (0,_baseGetTag/* default */.Z)(value) != objectTag) {
5732 return false;
5733 }
5734 var proto = (0,_getPrototype/* default */.Z)(value);
5735 if (proto === null) {
5736 return true;
5737 }
5738 var Ctor = isPlainObject_hasOwnProperty.call(proto, 'constructor') && proto.constructor;
5739 return typeof Ctor == 'function' && Ctor instanceof Ctor &&
5740 funcToString.call(Ctor) == objectCtorString;
5741 }
5742
5743 /* harmony default export */ const lodash_es_isPlainObject = (isPlainObject);
5744
5745 // EXTERNAL MODULE: ../node_modules/lodash-es/isTypedArray.js + 1 modules
5746 var isTypedArray = __webpack_require__(14923);
5747 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_safeGet.js
5748 /**
5749 * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
5750 *
5751 * @private
5752 * @param {Object} object The object to query.
5753 * @param {string} key The key of the property to get.
5754 * @returns {*} Returns the property value.
5755 */
5756 function safeGet(object, key) {
5757 if (key === 'constructor' && typeof object[key] === 'function') {
5758 return;
5759 }
5760
5761 if (key == '__proto__') {
5762 return;
5763 }
5764
5765 return object[key];
5766 }
5767
5768 /* harmony default export */ const _safeGet = (safeGet);
5769
5770 // EXTERNAL MODULE: ../node_modules/lodash-es/_copyObject.js
5771 var _copyObject = __webpack_require__(47313);
5772 // EXTERNAL MODULE: ../node_modules/lodash-es/keysIn.js + 2 modules
5773 var keysIn = __webpack_require__(48441);
5774 ;// CONCATENATED MODULE: ../node_modules/lodash-es/toPlainObject.js
5775
5776
5777
5778 /**
5779 * Converts `value` to a plain object flattening inherited enumerable string
5780 * keyed properties of `value` to own properties of the plain object.
5781 *
5782 * @static
5783 * @memberOf _
5784 * @since 3.0.0
5785 * @category Lang
5786 * @param {*} value The value to convert.
5787 * @returns {Object} Returns the converted plain object.
5788 * @example
5789 *
5790 * function Foo() {
5791 * this.b = 2;
5792 * }
5793 *
5794 * Foo.prototype.c = 3;
5795 *
5796 * _.assign({ 'a': 1 }, new Foo);
5797 * // => { 'a': 1, 'b': 2 }
5798 *
5799 * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
5800 * // => { 'a': 1, 'b': 2, 'c': 3 }
5801 */
5802 function toPlainObject(value) {
5803 return (0,_copyObject/* default */.Z)(value, (0,keysIn/* default */.Z)(value));
5804 }
5805
5806 /* harmony default export */ const lodash_es_toPlainObject = (toPlainObject);
5807
5808 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_baseMergeDeep.js
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825 /**
5826 * A specialized version of `baseMerge` for arrays and objects which performs
5827 * deep merges and tracks traversed objects enabling objects with circular
5828 * references to be merged.
5829 *
5830 * @private
5831 * @param {Object} object The destination object.
5832 * @param {Object} source The source object.
5833 * @param {string} key The key of the value to merge.
5834 * @param {number} srcIndex The index of `source`.
5835 * @param {Function} mergeFunc The function to merge values.
5836 * @param {Function} [customizer] The function to customize assigned values.
5837 * @param {Object} [stack] Tracks traversed source values and their merged
5838 * counterparts.
5839 */
5840 function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
5841 var objValue = _safeGet(object, key),
5842 srcValue = _safeGet(source, key),
5843 stacked = stack.get(srcValue);
5844
5845 if (stacked) {
5846 _assignMergeValue(object, key, stacked);
5847 return;
5848 }
5849 var newValue = customizer
5850 ? customizer(objValue, srcValue, (key + ''), object, source, stack)
5851 : undefined;
5852
5853 var isCommon = newValue === undefined;
5854
5855 if (isCommon) {
5856 var isArr = (0,isArray/* default */.Z)(srcValue),
5857 isBuff = !isArr && (0,isBuffer/* default */.Z)(srcValue),
5858 isTyped = !isArr && !isBuff && (0,isTypedArray/* default */.Z)(srcValue);
5859
5860 newValue = srcValue;
5861 if (isArr || isBuff || isTyped) {
5862 if ((0,isArray/* default */.Z)(objValue)) {
5863 newValue = objValue;
5864 }
5865 else if ((0,isArrayLikeObject/* default */.Z)(objValue)) {
5866 newValue = (0,_copyArray/* default */.Z)(objValue);
5867 }
5868 else if (isBuff) {
5869 isCommon = false;
5870 newValue = (0,_cloneBuffer/* default */.Z)(srcValue, true);
5871 }
5872 else if (isTyped) {
5873 isCommon = false;
5874 newValue = (0,_cloneTypedArray/* default */.Z)(srcValue, true);
5875 }
5876 else {
5877 newValue = [];
5878 }
5879 }
5880 else if (lodash_es_isPlainObject(srcValue) || (0,isArguments/* default */.Z)(srcValue)) {
5881 newValue = objValue;
5882 if ((0,isArguments/* default */.Z)(objValue)) {
5883 newValue = lodash_es_toPlainObject(objValue);
5884 }
5885 else if (!(0,isObject/* default */.Z)(objValue) || (0,isFunction/* default */.Z)(objValue)) {
5886 newValue = (0,_initCloneObject/* default */.Z)(srcValue);
5887 }
5888 }
5889 else {
5890 isCommon = false;
5891 }
5892 }
5893 if (isCommon) {
5894 // Recursively merge objects and arrays (susceptible to call stack limits).
5895 stack.set(srcValue, newValue);
5896 mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
5897 stack['delete'](srcValue);
5898 }
5899 _assignMergeValue(object, key, newValue);
5900 }
5901
5902 /* harmony default export */ const _baseMergeDeep = (baseMergeDeep);
5903
5904 ;// CONCATENATED MODULE: ../node_modules/lodash-es/_baseMerge.js
5905
5906
5907
5908
5909
5910
5911
5912
5913 /**
5914 * The base implementation of `_.merge` without support for multiple sources.
5915 *
5916 * @private
5917 * @param {Object} object The destination object.
5918 * @param {Object} source The source object.
5919 * @param {number} srcIndex The index of `source`.
5920 * @param {Function} [customizer] The function to customize merged values.
5921 * @param {Object} [stack] Tracks traversed source values and their merged
5922 * counterparts.
5923 */
5924 function baseMerge(object, source, srcIndex, customizer, stack) {
5925 if (object === source) {
5926 return;
5927 }
5928 (0,_baseFor/* default */.Z)(source, function(srcValue, key) {
5929 stack || (stack = new _Stack/* default */.Z);
5930 if ((0,isObject/* default */.Z)(srcValue)) {
5931 _baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
5932 }
5933 else {
5934 var newValue = customizer
5935 ? customizer(_safeGet(object, key), srcValue, (key + ''), object, source, stack)
5936 : undefined;
5937
5938 if (newValue === undefined) {
5939 newValue = srcValue;
5940 }
5941 _assignMergeValue(object, key, newValue);
5942 }
5943 }, keysIn/* default */.Z);
5944 }
5945
5946 /* harmony default export */ const _baseMerge = (baseMerge);
5947
5948 // EXTERNAL MODULE: ../node_modules/lodash-es/_createAssigner.js
5949 var _createAssigner = __webpack_require__(40690);
5950 ;// CONCATENATED MODULE: ../node_modules/lodash-es/merge.js
5951
5952
5953
5954 /**
5955 * This method is like `_.assign` except that it recursively merges own and
5956 * inherited enumerable string keyed properties of source objects into the
5957 * destination object. Source properties that resolve to `undefined` are
5958 * skipped if a destination value exists. Array and plain object properties
5959 * are merged recursively. Other objects and value types are overridden by
5960 * assignment. Source objects are applied from left to right. Subsequent
5961 * sources overwrite property assignments of previous sources.
5962 *
5963 * **Note:** This method mutates `object`.
5964 *
5965 * @static
5966 * @memberOf _
5967 * @since 0.5.0
5968 * @category Object
5969 * @param {Object} object The destination object.
5970 * @param {...Object} [sources] The source objects.
5971 * @returns {Object} Returns `object`.
5972 * @example
5973 *
5974 * var object = {
5975 * 'a': [{ 'b': 2 }, { 'd': 4 }]
5976 * };
5977 *
5978 * var other = {
5979 * 'a': [{ 'c': 3 }, { 'e': 5 }]
5980 * };
5981 *
5982 * _.merge(object, other);
5983 * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
5984 */
5985 var merge = (0,_createAssigner/* default */.Z)(function(object, source, srcIndex) {
5986 _baseMerge(object, source, srcIndex);
5987 });
5988
5989 /* harmony default export */ const lodash_es_merge = (merge);
5990
5991
5992 /***/ }),
5993
5994 /***/ 57385:
5995 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5996
5997 "use strict";
5998 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5999 /* harmony export */ X: () => (/* binding */ package_default)
6000 /* harmony export */ });
6001 // package.json
6002 var package_default = {
6003 name: "mermaid",
6004 version: "11.6.0",
6005 description: "Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.",
6006 type: "module",
6007 module: "./dist/mermaid.core.mjs",
6008 types: "./dist/mermaid.d.ts",
6009 exports: {
6010 ".": {
6011 types: "./dist/mermaid.d.ts",
6012 import: "./dist/mermaid.core.mjs",
6013 default: "./dist/mermaid.core.mjs"
6014 },
6015 "./*": "./*"
6016 },
6017 keywords: [
6018 "diagram",
6019 "markdown",
6020 "flowchart",
6021 "sequence diagram",
6022 "gantt",
6023 "class diagram",
6024 "git graph",
6025 "mindmap",
6026 "packet diagram",
6027 "c4 diagram",
6028 "er diagram",
6029 "pie chart",
6030 "pie diagram",
6031 "quadrant chart",
6032 "requirement diagram",
6033 "graph"
6034 ],
6035 scripts: {
6036 clean: "rimraf dist",
6037 dev: "pnpm -w dev",
6038 "docs:code": "typedoc src/defaultConfig.ts src/config.ts src/mermaid.ts && prettier --write ./src/docs/config/setup",
6039 "docs:build": "rimraf ../../docs && pnpm docs:code && pnpm docs:spellcheck && tsx scripts/docs.cli.mts",
6040 "docs:verify": "pnpm docs:code && pnpm docs:spellcheck && tsx scripts/docs.cli.mts --verify",
6041 "docs:pre:vitepress": "pnpm --filter ./src/docs prefetch && rimraf src/vitepress && pnpm docs:code && tsx scripts/docs.cli.mts --vitepress && pnpm --filter ./src/vitepress install --no-frozen-lockfile --ignore-scripts",
6042 "docs:build:vitepress": "pnpm docs:pre:vitepress && (cd src/vitepress && pnpm run build) && cpy --flat src/docs/landing/ ./src/vitepress/.vitepress/dist/landing",
6043 "docs:dev": 'pnpm docs:pre:vitepress && concurrently "pnpm --filter ./src/vitepress dev" "tsx scripts/docs.cli.mts --watch --vitepress"',
6044 "docs:dev:docker": 'pnpm docs:pre:vitepress && concurrently "pnpm --filter ./src/vitepress dev:docker" "tsx scripts/docs.cli.mts --watch --vitepress"',
6045 "docs:serve": "pnpm docs:build:vitepress && vitepress serve src/vitepress",
6046 "docs:spellcheck": 'cspell "src/docs/**/*.md"',
6047 "docs:release-version": "tsx scripts/update-release-version.mts",
6048 "docs:verify-version": "tsx scripts/update-release-version.mts --verify",
6049 "types:build-config": "tsx scripts/create-types-from-json-schema.mts",
6050 "types:verify-config": "tsx scripts/create-types-from-json-schema.mts --verify",
6051 checkCircle: "npx madge --circular ./src",
6052 prepublishOnly: "pnpm docs:verify-version"
6053 },
6054 repository: {
6055 type: "git",
6056 url: "https://github.com/mermaid-js/mermaid"
6057 },
6058 author: "Knut Sveidqvist",
6059 license: "MIT",
6060 standard: {
6061 ignore: [
6062 "**/parser/*.js",
6063 "dist/**/*.js",
6064 "cypress/**/*.js"
6065 ],
6066 globals: [
6067 "page"
6068 ]
6069 },
6070 dependencies: {
6071 "@braintree/sanitize-url": "^7.0.4",
6072 "@iconify/utils": "^2.1.33",
6073 "@mermaid-js/parser": "workspace:^",
6074 "@types/d3": "^7.4.3",
6075 cytoscape: "^3.29.3",
6076 "cytoscape-cose-bilkent": "^4.1.0",
6077 "cytoscape-fcose": "^2.2.0",
6078 d3: "^7.9.0",
6079 "d3-sankey": "^0.12.3",
6080 "dagre-d3-es": "7.0.11",
6081 dayjs: "^1.11.13",
6082 dompurify: "^3.2.4",
6083 katex: "^0.16.9",
6084 khroma: "^2.1.0",
6085 "lodash-es": "^4.17.21",
6086 marked: "^15.0.7",
6087 roughjs: "^4.6.6",
6088 stylis: "^4.3.6",
6089 "ts-dedent": "^2.2.0",
6090 uuid: "^11.1.0"
6091 },
6092 devDependencies: {
6093 "@adobe/jsonschema2md": "^8.0.2",
6094 "@iconify/types": "^2.0.0",
6095 "@types/cytoscape": "^3.21.9",
6096 "@types/cytoscape-fcose": "^2.2.4",
6097 "@types/d3-sankey": "^0.12.4",
6098 "@types/d3-scale": "^4.0.9",
6099 "@types/d3-scale-chromatic": "^3.1.0",
6100 "@types/d3-selection": "^3.0.11",
6101 "@types/d3-shape": "^3.1.7",
6102 "@types/jsdom": "^21.1.7",
6103 "@types/katex": "^0.16.7",
6104 "@types/lodash-es": "^4.17.12",
6105 "@types/micromatch": "^4.0.9",
6106 "@types/stylis": "^4.2.7",
6107 "@types/uuid": "^10.0.0",
6108 ajv: "^8.17.1",
6109 chokidar: "^4.0.3",
6110 concurrently: "^9.1.2",
6111 "csstree-validator": "^4.0.1",
6112 globby: "^14.0.2",
6113 jison: "^0.4.18",
6114 "js-base64": "^3.7.7",
6115 jsdom: "^26.0.0",
6116 "json-schema-to-typescript": "^15.0.4",
6117 micromatch: "^4.0.8",
6118 "path-browserify": "^1.0.1",
6119 prettier: "^3.5.2",
6120 remark: "^15.0.1",
6121 "remark-frontmatter": "^5.0.0",
6122 "remark-gfm": "^4.0.1",
6123 rimraf: "^6.0.1",
6124 "start-server-and-test": "^2.0.10",
6125 "type-fest": "^4.35.0",
6126 typedoc: "^0.27.8",
6127 "typedoc-plugin-markdown": "^4.4.2",
6128 typescript: "~5.7.3",
6129 "unist-util-flatmap": "^1.0.0",
6130 "unist-util-visit": "^5.0.0",
6131 vitepress: "^1.0.2",
6132 "vitepress-plugin-search": "1.0.4-alpha.22"
6133 },
6134 files: [
6135 "dist/",
6136 "README.md"
6137 ],
6138 publishConfig: {
6139 access: "public"
6140 }
6141 };
6142
6143
6144
6145
6146 /***/ }),
6147
6148 /***/ 98719:
6149 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6150
6151 "use strict";
6152 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6153 /* harmony export */ A: () => (/* binding */ JSON_SCHEMA),
6154 /* harmony export */ z: () => (/* binding */ load)
6155 /* harmony export */ });
6156 /* harmony import */ var _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(86906);
6157
6158
6159 // ../../node_modules/.pnpm/js-yaml@4.1.0/node_modules/js-yaml/dist/js-yaml.mjs
6160 function isNothing(subject) {
6161 return typeof subject === "undefined" || subject === null;
6162 }
6163 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(isNothing, "isNothing");
6164 function isObject(subject) {
6165 return typeof subject === "object" && subject !== null;
6166 }
6167 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(isObject, "isObject");
6168 function toArray(sequence) {
6169 if (Array.isArray(sequence)) return sequence;
6170 else if (isNothing(sequence)) return [];
6171 return [sequence];
6172 }
6173 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(toArray, "toArray");
6174 function extend(target, source) {
6175 var index, length, key, sourceKeys;
6176 if (source) {
6177 sourceKeys = Object.keys(source);
6178 for (index = 0, length = sourceKeys.length; index < length; index += 1) {
6179 key = sourceKeys[index];
6180 target[key] = source[key];
6181 }
6182 }
6183 return target;
6184 }
6185 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(extend, "extend");
6186 function repeat(string, count) {
6187 var result = "", cycle;
6188 for (cycle = 0; cycle < count; cycle += 1) {
6189 result += string;
6190 }
6191 return result;
6192 }
6193 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(repeat, "repeat");
6194 function isNegativeZero(number) {
6195 return number === 0 && Number.NEGATIVE_INFINITY === 1 / number;
6196 }
6197 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(isNegativeZero, "isNegativeZero");
6198 var isNothing_1 = isNothing;
6199 var isObject_1 = isObject;
6200 var toArray_1 = toArray;
6201 var repeat_1 = repeat;
6202 var isNegativeZero_1 = isNegativeZero;
6203 var extend_1 = extend;
6204 var common = {
6205 isNothing: isNothing_1,
6206 isObject: isObject_1,
6207 toArray: toArray_1,
6208 repeat: repeat_1,
6209 isNegativeZero: isNegativeZero_1,
6210 extend: extend_1
6211 };
6212 function formatError(exception2, compact) {
6213 var where = "", message = exception2.reason || "(unknown reason)";
6214 if (!exception2.mark) return message;
6215 if (exception2.mark.name) {
6216 where += 'in "' + exception2.mark.name + '" ';
6217 }
6218 where += "(" + (exception2.mark.line + 1) + ":" + (exception2.mark.column + 1) + ")";
6219 if (!compact && exception2.mark.snippet) {
6220 where += "\n\n" + exception2.mark.snippet;
6221 }
6222 return message + " " + where;
6223 }
6224 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(formatError, "formatError");
6225 function YAMLException$1(reason, mark) {
6226 Error.call(this);
6227 this.name = "YAMLException";
6228 this.reason = reason;
6229 this.mark = mark;
6230 this.message = formatError(this, false);
6231 if (Error.captureStackTrace) {
6232 Error.captureStackTrace(this, this.constructor);
6233 } else {
6234 this.stack = new Error().stack || "";
6235 }
6236 }
6237 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(YAMLException$1, "YAMLException$1");
6238 YAMLException$1.prototype = Object.create(Error.prototype);
6239 YAMLException$1.prototype.constructor = YAMLException$1;
6240 YAMLException$1.prototype.toString = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(function toString(compact) {
6241 return this.name + ": " + formatError(this, compact);
6242 }, "toString");
6243 var exception = YAMLException$1;
6244 function getLine(buffer, lineStart, lineEnd, position, maxLineLength) {
6245 var head = "";
6246 var tail = "";
6247 var maxHalfLength = Math.floor(maxLineLength / 2) - 1;
6248 if (position - lineStart > maxHalfLength) {
6249 head = " ... ";
6250 lineStart = position - maxHalfLength + head.length;
6251 }
6252 if (lineEnd - position > maxHalfLength) {
6253 tail = " ...";
6254 lineEnd = position + maxHalfLength - tail.length;
6255 }
6256 return {
6257 str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, "\u2192") + tail,
6258 pos: position - lineStart + head.length
6259 // relative position
6260 };
6261 }
6262 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(getLine, "getLine");
6263 function padStart(string, max) {
6264 return common.repeat(" ", max - string.length) + string;
6265 }
6266 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(padStart, "padStart");
6267 function makeSnippet(mark, options) {
6268 options = Object.create(options || null);
6269 if (!mark.buffer) return null;
6270 if (!options.maxLength) options.maxLength = 79;
6271 if (typeof options.indent !== "number") options.indent = 1;
6272 if (typeof options.linesBefore !== "number") options.linesBefore = 3;
6273 if (typeof options.linesAfter !== "number") options.linesAfter = 2;
6274 var re = /\r?\n|\r|\0/g;
6275 var lineStarts = [0];
6276 var lineEnds = [];
6277 var match;
6278 var foundLineNo = -1;
6279 while (match = re.exec(mark.buffer)) {
6280 lineEnds.push(match.index);
6281 lineStarts.push(match.index + match[0].length);
6282 if (mark.position <= match.index && foundLineNo < 0) {
6283 foundLineNo = lineStarts.length - 2;
6284 }
6285 }
6286 if (foundLineNo < 0) foundLineNo = lineStarts.length - 1;
6287 var result = "", i, line;
6288 var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length;
6289 var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3);
6290 for (i = 1; i <= options.linesBefore; i++) {
6291 if (foundLineNo - i < 0) break;
6292 line = getLine(
6293 mark.buffer,
6294 lineStarts[foundLineNo - i],
6295 lineEnds[foundLineNo - i],
6296 mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]),
6297 maxLineLength
6298 );
6299 result = common.repeat(" ", options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + " | " + line.str + "\n" + result;
6300 }
6301 line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength);
6302 result += common.repeat(" ", options.indent) + padStart((mark.line + 1).toString(), lineNoLength) + " | " + line.str + "\n";
6303 result += common.repeat("-", options.indent + lineNoLength + 3 + line.pos) + "^\n";
6304 for (i = 1; i <= options.linesAfter; i++) {
6305 if (foundLineNo + i >= lineEnds.length) break;
6306 line = getLine(
6307 mark.buffer,
6308 lineStarts[foundLineNo + i],
6309 lineEnds[foundLineNo + i],
6310 mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]),
6311 maxLineLength
6312 );
6313 result += common.repeat(" ", options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) + " | " + line.str + "\n";
6314 }
6315 return result.replace(/\n$/, "");
6316 }
6317 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(makeSnippet, "makeSnippet");
6318 var snippet = makeSnippet;
6319 var TYPE_CONSTRUCTOR_OPTIONS = [
6320 "kind",
6321 "multi",
6322 "resolve",
6323 "construct",
6324 "instanceOf",
6325 "predicate",
6326 "represent",
6327 "representName",
6328 "defaultStyle",
6329 "styleAliases"
6330 ];
6331 var YAML_NODE_KINDS = [
6332 "scalar",
6333 "sequence",
6334 "mapping"
6335 ];
6336 function compileStyleAliases(map2) {
6337 var result = {};
6338 if (map2 !== null) {
6339 Object.keys(map2).forEach(function(style) {
6340 map2[style].forEach(function(alias) {
6341 result[String(alias)] = style;
6342 });
6343 });
6344 }
6345 return result;
6346 }
6347 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(compileStyleAliases, "compileStyleAliases");
6348 function Type$1(tag, options) {
6349 options = options || {};
6350 Object.keys(options).forEach(function(name) {
6351 if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
6352 throw new exception('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
6353 }
6354 });
6355 this.options = options;
6356 this.tag = tag;
6357 this.kind = options["kind"] || null;
6358 this.resolve = options["resolve"] || function() {
6359 return true;
6360 };
6361 this.construct = options["construct"] || function(data) {
6362 return data;
6363 };
6364 this.instanceOf = options["instanceOf"] || null;
6365 this.predicate = options["predicate"] || null;
6366 this.represent = options["represent"] || null;
6367 this.representName = options["representName"] || null;
6368 this.defaultStyle = options["defaultStyle"] || null;
6369 this.multi = options["multi"] || false;
6370 this.styleAliases = compileStyleAliases(options["styleAliases"] || null);
6371 if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
6372 throw new exception('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
6373 }
6374 }
6375 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(Type$1, "Type$1");
6376 var type = Type$1;
6377 function compileList(schema2, name) {
6378 var result = [];
6379 schema2[name].forEach(function(currentType) {
6380 var newIndex = result.length;
6381 result.forEach(function(previousType, previousIndex) {
6382 if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) {
6383 newIndex = previousIndex;
6384 }
6385 });
6386 result[newIndex] = currentType;
6387 });
6388 return result;
6389 }
6390 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(compileList, "compileList");
6391 function compileMap() {
6392 var result = {
6393 scalar: {},
6394 sequence: {},
6395 mapping: {},
6396 fallback: {},
6397 multi: {
6398 scalar: [],
6399 sequence: [],
6400 mapping: [],
6401 fallback: []
6402 }
6403 }, index, length;
6404 function collectType(type2) {
6405 if (type2.multi) {
6406 result.multi[type2.kind].push(type2);
6407 result.multi["fallback"].push(type2);
6408 } else {
6409 result[type2.kind][type2.tag] = result["fallback"][type2.tag] = type2;
6410 }
6411 }
6412 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(collectType, "collectType");
6413 for (index = 0, length = arguments.length; index < length; index += 1) {
6414 arguments[index].forEach(collectType);
6415 }
6416 return result;
6417 }
6418 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(compileMap, "compileMap");
6419 function Schema$1(definition) {
6420 return this.extend(definition);
6421 }
6422 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(Schema$1, "Schema$1");
6423 Schema$1.prototype.extend = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(function extend2(definition) {
6424 var implicit = [];
6425 var explicit = [];
6426 if (definition instanceof type) {
6427 explicit.push(definition);
6428 } else if (Array.isArray(definition)) {
6429 explicit = explicit.concat(definition);
6430 } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {
6431 if (definition.implicit) implicit = implicit.concat(definition.implicit);
6432 if (definition.explicit) explicit = explicit.concat(definition.explicit);
6433 } else {
6434 throw new exception("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
6435 }
6436 implicit.forEach(function(type$1) {
6437 if (!(type$1 instanceof type)) {
6438 throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object.");
6439 }
6440 if (type$1.loadKind && type$1.loadKind !== "scalar") {
6441 throw new exception("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
6442 }
6443 if (type$1.multi) {
6444 throw new exception("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
6445 }
6446 });
6447 explicit.forEach(function(type$1) {
6448 if (!(type$1 instanceof type)) {
6449 throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object.");
6450 }
6451 });
6452 var result = Object.create(Schema$1.prototype);
6453 result.implicit = (this.implicit || []).concat(implicit);
6454 result.explicit = (this.explicit || []).concat(explicit);
6455 result.compiledImplicit = compileList(result, "implicit");
6456 result.compiledExplicit = compileList(result, "explicit");
6457 result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit);
6458 return result;
6459 }, "extend");
6460 var schema = Schema$1;
6461 var str = new type("tag:yaml.org,2002:str", {
6462 kind: "scalar",
6463 construct: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(function(data) {
6464 return data !== null ? data : "";
6465 }, "construct")
6466 });
6467 var seq = new type("tag:yaml.org,2002:seq", {
6468 kind: "sequence",
6469 construct: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(function(data) {
6470 return data !== null ? data : [];
6471 }, "construct")
6472 });
6473 var map = new type("tag:yaml.org,2002:map", {
6474 kind: "mapping",
6475 construct: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(function(data) {
6476 return data !== null ? data : {};
6477 }, "construct")
6478 });
6479 var failsafe = new schema({
6480 explicit: [
6481 str,
6482 seq,
6483 map
6484 ]
6485 });
6486 function resolveYamlNull(data) {
6487 if (data === null) return true;
6488 var max = data.length;
6489 return max === 1 && data === "~" || max === 4 && (data === "null" || data === "Null" || data === "NULL");
6490 }
6491 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(resolveYamlNull, "resolveYamlNull");
6492 function constructYamlNull() {
6493 return null;
6494 }
6495 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(constructYamlNull, "constructYamlNull");
6496 function isNull(object) {
6497 return object === null;
6498 }
6499 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(isNull, "isNull");
6500 var _null = new type("tag:yaml.org,2002:null", {
6501 kind: "scalar",
6502 resolve: resolveYamlNull,
6503 construct: constructYamlNull,
6504 predicate: isNull,
6505 represent: {
6506 canonical: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(function() {
6507 return "~";
6508 }, "canonical"),
6509 lowercase: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(function() {
6510 return "null";
6511 }, "lowercase"),
6512 uppercase: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(function() {
6513 return "NULL";
6514 }, "uppercase"),
6515 camelcase: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(function() {
6516 return "Null";
6517 }, "camelcase"),
6518 empty: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(function() {
6519 return "";
6520 }, "empty")
6521 },
6522 defaultStyle: "lowercase"
6523 });
6524 function resolveYamlBoolean(data) {
6525 if (data === null) return false;
6526 var max = data.length;
6527 return max === 4 && (data === "true" || data === "True" || data === "TRUE") || max === 5 && (data === "false" || data === "False" || data === "FALSE");
6528 }
6529 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(resolveYamlBoolean, "resolveYamlBoolean");
6530 function constructYamlBoolean(data) {
6531 return data === "true" || data === "True" || data === "TRUE";
6532 }
6533 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(constructYamlBoolean, "constructYamlBoolean");
6534 function isBoolean(object) {
6535 return Object.prototype.toString.call(object) === "[object Boolean]";
6536 }
6537 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(isBoolean, "isBoolean");
6538 var bool = new type("tag:yaml.org,2002:bool", {
6539 kind: "scalar",
6540 resolve: resolveYamlBoolean,
6541 construct: constructYamlBoolean,
6542 predicate: isBoolean,
6543 represent: {
6544 lowercase: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(function(object) {
6545 return object ? "true" : "false";
6546 }, "lowercase"),
6547 uppercase: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(function(object) {
6548 return object ? "TRUE" : "FALSE";
6549 }, "uppercase"),
6550 camelcase: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(function(object) {
6551 return object ? "True" : "False";
6552 }, "camelcase")
6553 },
6554 defaultStyle: "lowercase"
6555 });
6556 function isHexCode(c) {
6557 return 48 <= c && c <= 57 || 65 <= c && c <= 70 || 97 <= c && c <= 102;
6558 }
6559 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(isHexCode, "isHexCode");
6560 function isOctCode(c) {
6561 return 48 <= c && c <= 55;
6562 }
6563 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(isOctCode, "isOctCode");
6564 function isDecCode(c) {
6565 return 48 <= c && c <= 57;
6566 }
6567 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(isDecCode, "isDecCode");
6568 function resolveYamlInteger(data) {
6569 if (data === null) return false;
6570 var max = data.length, index = 0, hasDigits = false, ch;
6571 if (!max) return false;
6572 ch = data[index];
6573 if (ch === "-" || ch === "+") {
6574 ch = data[++index];
6575 }
6576 if (ch === "0") {
6577 if (index + 1 === max) return true;
6578 ch = data[++index];
6579 if (ch === "b") {
6580 index++;
6581 for (; index < max; index++) {
6582 ch = data[index];
6583 if (ch === "_") continue;
6584 if (ch !== "0" && ch !== "1") return false;
6585 hasDigits = true;
6586 }
6587 return hasDigits && ch !== "_";
6588 }
6589 if (ch === "x") {
6590 index++;
6591 for (; index < max; index++) {
6592 ch = data[index];
6593 if (ch === "_") continue;
6594 if (!isHexCode(data.charCodeAt(index))) return false;
6595 hasDigits = true;
6596 }
6597 return hasDigits && ch !== "_";
6598 }
6599 if (ch === "o") {
6600 index++;
6601 for (; index < max; index++) {
6602 ch = data[index];
6603 if (ch === "_") continue;
6604 if (!isOctCode(data.charCodeAt(index))) return false;
6605 hasDigits = true;
6606 }
6607 return hasDigits && ch !== "_";
6608 }
6609 }
6610 if (ch === "_") return false;
6611 for (; index < max; index++) {
6612 ch = data[index];
6613 if (ch === "_") continue;
6614 if (!isDecCode(data.charCodeAt(index))) {
6615 return false;
6616 }
6617 hasDigits = true;
6618 }
6619 if (!hasDigits || ch === "_") return false;
6620 return true;
6621 }
6622 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(resolveYamlInteger, "resolveYamlInteger");
6623 function constructYamlInteger(data) {
6624 var value = data, sign = 1, ch;
6625 if (value.indexOf("_") !== -1) {
6626 value = value.replace(/_/g, "");
6627 }
6628 ch = value[0];
6629 if (ch === "-" || ch === "+") {
6630 if (ch === "-") sign = -1;
6631 value = value.slice(1);
6632 ch = value[0];
6633 }
6634 if (value === "0") return 0;
6635 if (ch === "0") {
6636 if (value[1] === "b") return sign * parseInt(value.slice(2), 2);
6637 if (value[1] === "x") return sign * parseInt(value.slice(2), 16);
6638 if (value[1] === "o") return sign * parseInt(value.slice(2), 8);
6639 }
6640 return sign * parseInt(value, 10);
6641 }
6642 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(constructYamlInteger, "constructYamlInteger");
6643 function isInteger(object) {
6644 return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 === 0 && !common.isNegativeZero(object));
6645 }
6646 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(isInteger, "isInteger");
6647 var int = new type("tag:yaml.org,2002:int", {
6648 kind: "scalar",
6649 resolve: resolveYamlInteger,
6650 construct: constructYamlInteger,
6651 predicate: isInteger,
6652 represent: {
6653 binary: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(function(obj) {
6654 return obj >= 0 ? "0b" + obj.toString(2) : "-0b" + obj.toString(2).slice(1);
6655 }, "binary"),
6656 octal: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(function(obj) {
6657 return obj >= 0 ? "0o" + obj.toString(8) : "-0o" + obj.toString(8).slice(1);
6658 }, "octal"),
6659 decimal: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(function(obj) {
6660 return obj.toString(10);
6661 }, "decimal"),
6662 /* eslint-disable max-len */
6663 hexadecimal: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(function(obj) {
6664 return obj >= 0 ? "0x" + obj.toString(16).toUpperCase() : "-0x" + obj.toString(16).toUpperCase().slice(1);
6665 }, "hexadecimal")
6666 },
6667 defaultStyle: "decimal",
6668 styleAliases: {
6669 binary: [2, "bin"],
6670 octal: [8, "oct"],
6671 decimal: [10, "dec"],
6672 hexadecimal: [16, "hex"]
6673 }
6674 });
6675 var YAML_FLOAT_PATTERN = new RegExp(
6676 // 2.5e4, 2.5 and integers
6677 "^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"
6678 );
6679 function resolveYamlFloat(data) {
6680 if (data === null) return false;
6681 if (!YAML_FLOAT_PATTERN.test(data) || // Quick hack to not allow integers end with `_`
6682 // Probably should update regexp & check speed
6683 data[data.length - 1] === "_") {
6684 return false;
6685 }
6686 return true;
6687 }
6688 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(resolveYamlFloat, "resolveYamlFloat");
6689 function constructYamlFloat(data) {
6690 var value, sign;
6691 value = data.replace(/_/g, "").toLowerCase();
6692 sign = value[0] === "-" ? -1 : 1;
6693 if ("+-".indexOf(value[0]) >= 0) {
6694 value = value.slice(1);
6695 }
6696 if (value === ".inf") {
6697 return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
6698 } else if (value === ".nan") {
6699 return NaN;
6700 }
6701 return sign * parseFloat(value, 10);
6702 }
6703 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(constructYamlFloat, "constructYamlFloat");
6704 var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
6705 function representYamlFloat(object, style) {
6706 var res;
6707 if (isNaN(object)) {
6708 switch (style) {
6709 case "lowercase":
6710 return ".nan";
6711 case "uppercase":
6712 return ".NAN";
6713 case "camelcase":
6714 return ".NaN";
6715 }
6716 } else if (Number.POSITIVE_INFINITY === object) {
6717 switch (style) {
6718 case "lowercase":
6719 return ".inf";
6720 case "uppercase":
6721 return ".INF";
6722 case "camelcase":
6723 return ".Inf";
6724 }
6725 } else if (Number.NEGATIVE_INFINITY === object) {
6726 switch (style) {
6727 case "lowercase":
6728 return "-.inf";
6729 case "uppercase":
6730 return "-.INF";
6731 case "camelcase":
6732 return "-.Inf";
6733 }
6734 } else if (common.isNegativeZero(object)) {
6735 return "-0.0";
6736 }
6737 res = object.toString(10);
6738 return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace("e", ".e") : res;
6739 }
6740 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(representYamlFloat, "representYamlFloat");
6741 function isFloat(object) {
6742 return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 !== 0 || common.isNegativeZero(object));
6743 }
6744 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(isFloat, "isFloat");
6745 var float = new type("tag:yaml.org,2002:float", {
6746 kind: "scalar",
6747 resolve: resolveYamlFloat,
6748 construct: constructYamlFloat,
6749 predicate: isFloat,
6750 represent: representYamlFloat,
6751 defaultStyle: "lowercase"
6752 });
6753 var json = failsafe.extend({
6754 implicit: [
6755 _null,
6756 bool,
6757 int,
6758 float
6759 ]
6760 });
6761 var core = json;
6762 var YAML_DATE_REGEXP = new RegExp(
6763 "^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"
6764 );
6765 var YAML_TIMESTAMP_REGEXP = new RegExp(
6766 "^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"
6767 );
6768 function resolveYamlTimestamp(data) {
6769 if (data === null) return false;
6770 if (YAML_DATE_REGEXP.exec(data) !== null) return true;
6771 if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true;
6772 return false;
6773 }
6774 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(resolveYamlTimestamp, "resolveYamlTimestamp");
6775 function constructYamlTimestamp(data) {
6776 var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date;
6777 match = YAML_DATE_REGEXP.exec(data);
6778 if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);
6779 if (match === null) throw new Error("Date resolve error");
6780 year = +match[1];
6781 month = +match[2] - 1;
6782 day = +match[3];
6783 if (!match[4]) {
6784 return new Date(Date.UTC(year, month, day));
6785 }
6786 hour = +match[4];
6787 minute = +match[5];
6788 second = +match[6];
6789 if (match[7]) {
6790 fraction = match[7].slice(0, 3);
6791 while (fraction.length < 3) {
6792 fraction += "0";
6793 }
6794 fraction = +fraction;
6795 }
6796 if (match[9]) {
6797 tz_hour = +match[10];
6798 tz_minute = +(match[11] || 0);
6799 delta = (tz_hour * 60 + tz_minute) * 6e4;
6800 if (match[9] === "-") delta = -delta;
6801 }
6802 date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
6803 if (delta) date.setTime(date.getTime() - delta);
6804 return date;
6805 }
6806 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(constructYamlTimestamp, "constructYamlTimestamp");
6807 function representYamlTimestamp(object) {
6808 return object.toISOString();
6809 }
6810 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(representYamlTimestamp, "representYamlTimestamp");
6811 var timestamp = new type("tag:yaml.org,2002:timestamp", {
6812 kind: "scalar",
6813 resolve: resolveYamlTimestamp,
6814 construct: constructYamlTimestamp,
6815 instanceOf: Date,
6816 represent: representYamlTimestamp
6817 });
6818 function resolveYamlMerge(data) {
6819 return data === "<<" || data === null;
6820 }
6821 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(resolveYamlMerge, "resolveYamlMerge");
6822 var merge = new type("tag:yaml.org,2002:merge", {
6823 kind: "scalar",
6824 resolve: resolveYamlMerge
6825 });
6826 var BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";
6827 function resolveYamlBinary(data) {
6828 if (data === null) return false;
6829 var code, idx, bitlen = 0, max = data.length, map2 = BASE64_MAP;
6830 for (idx = 0; idx < max; idx++) {
6831 code = map2.indexOf(data.charAt(idx));
6832 if (code > 64) continue;
6833 if (code < 0) return false;
6834 bitlen += 6;
6835 }
6836 return bitlen % 8 === 0;
6837 }
6838 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(resolveYamlBinary, "resolveYamlBinary");
6839 function constructYamlBinary(data) {
6840 var idx, tailbits, input = data.replace(/[\r\n=]/g, ""), max = input.length, map2 = BASE64_MAP, bits = 0, result = [];
6841 for (idx = 0; idx < max; idx++) {
6842 if (idx % 4 === 0 && idx) {
6843 result.push(bits >> 16 & 255);
6844 result.push(bits >> 8 & 255);
6845 result.push(bits & 255);
6846 }
6847 bits = bits << 6 | map2.indexOf(input.charAt(idx));
6848 }
6849 tailbits = max % 4 * 6;
6850 if (tailbits === 0) {
6851 result.push(bits >> 16 & 255);
6852 result.push(bits >> 8 & 255);
6853 result.push(bits & 255);
6854 } else if (tailbits === 18) {
6855 result.push(bits >> 10 & 255);
6856 result.push(bits >> 2 & 255);
6857 } else if (tailbits === 12) {
6858 result.push(bits >> 4 & 255);
6859 }
6860 return new Uint8Array(result);
6861 }
6862 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(constructYamlBinary, "constructYamlBinary");
6863 function representYamlBinary(object) {
6864 var result = "", bits = 0, idx, tail, max = object.length, map2 = BASE64_MAP;
6865 for (idx = 0; idx < max; idx++) {
6866 if (idx % 3 === 0 && idx) {
6867 result += map2[bits >> 18 & 63];
6868 result += map2[bits >> 12 & 63];
6869 result += map2[bits >> 6 & 63];
6870 result += map2[bits & 63];
6871 }
6872 bits = (bits << 8) + object[idx];
6873 }
6874 tail = max % 3;
6875 if (tail === 0) {
6876 result += map2[bits >> 18 & 63];
6877 result += map2[bits >> 12 & 63];
6878 result += map2[bits >> 6 & 63];
6879 result += map2[bits & 63];
6880 } else if (tail === 2) {
6881 result += map2[bits >> 10 & 63];
6882 result += map2[bits >> 4 & 63];
6883 result += map2[bits << 2 & 63];
6884 result += map2[64];
6885 } else if (tail === 1) {
6886 result += map2[bits >> 2 & 63];
6887 result += map2[bits << 4 & 63];
6888 result += map2[64];
6889 result += map2[64];
6890 }
6891 return result;
6892 }
6893 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(representYamlBinary, "representYamlBinary");
6894 function isBinary(obj) {
6895 return Object.prototype.toString.call(obj) === "[object Uint8Array]";
6896 }
6897 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(isBinary, "isBinary");
6898 var binary = new type("tag:yaml.org,2002:binary", {
6899 kind: "scalar",
6900 resolve: resolveYamlBinary,
6901 construct: constructYamlBinary,
6902 predicate: isBinary,
6903 represent: representYamlBinary
6904 });
6905 var _hasOwnProperty$3 = Object.prototype.hasOwnProperty;
6906 var _toString$2 = Object.prototype.toString;
6907 function resolveYamlOmap(data) {
6908 if (data === null) return true;
6909 var objectKeys = [], index, length, pair, pairKey, pairHasKey, object = data;
6910 for (index = 0, length = object.length; index < length; index += 1) {
6911 pair = object[index];
6912 pairHasKey = false;
6913 if (_toString$2.call(pair) !== "[object Object]") return false;
6914 for (pairKey in pair) {
6915 if (_hasOwnProperty$3.call(pair, pairKey)) {
6916 if (!pairHasKey) pairHasKey = true;
6917 else return false;
6918 }
6919 }
6920 if (!pairHasKey) return false;
6921 if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);
6922 else return false;
6923 }
6924 return true;
6925 }
6926 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(resolveYamlOmap, "resolveYamlOmap");
6927 function constructYamlOmap(data) {
6928 return data !== null ? data : [];
6929 }
6930 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(constructYamlOmap, "constructYamlOmap");
6931 var omap = new type("tag:yaml.org,2002:omap", {
6932 kind: "sequence",
6933 resolve: resolveYamlOmap,
6934 construct: constructYamlOmap
6935 });
6936 var _toString$1 = Object.prototype.toString;
6937 function resolveYamlPairs(data) {
6938 if (data === null) return true;
6939 var index, length, pair, keys, result, object = data;
6940 result = new Array(object.length);
6941 for (index = 0, length = object.length; index < length; index += 1) {
6942 pair = object[index];
6943 if (_toString$1.call(pair) !== "[object Object]") return false;
6944 keys = Object.keys(pair);
6945 if (keys.length !== 1) return false;
6946 result[index] = [keys[0], pair[keys[0]]];
6947 }
6948 return true;
6949 }
6950 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(resolveYamlPairs, "resolveYamlPairs");
6951 function constructYamlPairs(data) {
6952 if (data === null) return [];
6953 var index, length, pair, keys, result, object = data;
6954 result = new Array(object.length);
6955 for (index = 0, length = object.length; index < length; index += 1) {
6956 pair = object[index];
6957 keys = Object.keys(pair);
6958 result[index] = [keys[0], pair[keys[0]]];
6959 }
6960 return result;
6961 }
6962 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(constructYamlPairs, "constructYamlPairs");
6963 var pairs = new type("tag:yaml.org,2002:pairs", {
6964 kind: "sequence",
6965 resolve: resolveYamlPairs,
6966 construct: constructYamlPairs
6967 });
6968 var _hasOwnProperty$2 = Object.prototype.hasOwnProperty;
6969 function resolveYamlSet(data) {
6970 if (data === null) return true;
6971 var key, object = data;
6972 for (key in object) {
6973 if (_hasOwnProperty$2.call(object, key)) {
6974 if (object[key] !== null) return false;
6975 }
6976 }
6977 return true;
6978 }
6979 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(resolveYamlSet, "resolveYamlSet");
6980 function constructYamlSet(data) {
6981 return data !== null ? data : {};
6982 }
6983 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(constructYamlSet, "constructYamlSet");
6984 var set = new type("tag:yaml.org,2002:set", {
6985 kind: "mapping",
6986 resolve: resolveYamlSet,
6987 construct: constructYamlSet
6988 });
6989 var _default = core.extend({
6990 implicit: [
6991 timestamp,
6992 merge
6993 ],
6994 explicit: [
6995 binary,
6996 omap,
6997 pairs,
6998 set
6999 ]
7000 });
7001 var _hasOwnProperty$1 = Object.prototype.hasOwnProperty;
7002 var CONTEXT_FLOW_IN = 1;
7003 var CONTEXT_FLOW_OUT = 2;
7004 var CONTEXT_BLOCK_IN = 3;
7005 var CONTEXT_BLOCK_OUT = 4;
7006 var CHOMPING_CLIP = 1;
7007 var CHOMPING_STRIP = 2;
7008 var CHOMPING_KEEP = 3;
7009 var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
7010 var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
7011 var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
7012 var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
7013 var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
7014 function _class(obj) {
7015 return Object.prototype.toString.call(obj);
7016 }
7017 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(_class, "_class");
7018 function is_EOL(c) {
7019 return c === 10 || c === 13;
7020 }
7021 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(is_EOL, "is_EOL");
7022 function is_WHITE_SPACE(c) {
7023 return c === 9 || c === 32;
7024 }
7025 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(is_WHITE_SPACE, "is_WHITE_SPACE");
7026 function is_WS_OR_EOL(c) {
7027 return c === 9 || c === 32 || c === 10 || c === 13;
7028 }
7029 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(is_WS_OR_EOL, "is_WS_OR_EOL");
7030 function is_FLOW_INDICATOR(c) {
7031 return c === 44 || c === 91 || c === 93 || c === 123 || c === 125;
7032 }
7033 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(is_FLOW_INDICATOR, "is_FLOW_INDICATOR");
7034 function fromHexCode(c) {
7035 var lc;
7036 if (48 <= c && c <= 57) {
7037 return c - 48;
7038 }
7039 lc = c | 32;
7040 if (97 <= lc && lc <= 102) {
7041 return lc - 97 + 10;
7042 }
7043 return -1;
7044 }
7045 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(fromHexCode, "fromHexCode");
7046 function escapedHexLen(c) {
7047 if (c === 120) {
7048 return 2;
7049 }
7050 if (c === 117) {
7051 return 4;
7052 }
7053 if (c === 85) {
7054 return 8;
7055 }
7056 return 0;
7057 }
7058 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(escapedHexLen, "escapedHexLen");
7059 function fromDecimalCode(c) {
7060 if (48 <= c && c <= 57) {
7061 return c - 48;
7062 }
7063 return -1;
7064 }
7065 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(fromDecimalCode, "fromDecimalCode");
7066 function simpleEscapeSequence(c) {
7067 return c === 48 ? "\0" : c === 97 ? "\x07" : c === 98 ? "\b" : c === 116 ? " " : c === 9 ? " " : c === 110 ? "\n" : c === 118 ? "\v" : c === 102 ? "\f" : c === 114 ? "\r" : c === 101 ? "\x1B" : c === 32 ? " " : c === 34 ? '"' : c === 47 ? "/" : c === 92 ? "\\" : c === 78 ? "\x85" : c === 95 ? "\xA0" : c === 76 ? "\u2028" : c === 80 ? "\u2029" : "";
7068 }
7069 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(simpleEscapeSequence, "simpleEscapeSequence");
7070 function charFromCodepoint(c) {
7071 if (c <= 65535) {
7072 return String.fromCharCode(c);
7073 }
7074 return String.fromCharCode(
7075 (c - 65536 >> 10) + 55296,
7076 (c - 65536 & 1023) + 56320
7077 );
7078 }
7079 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(charFromCodepoint, "charFromCodepoint");
7080 var simpleEscapeCheck = new Array(256);
7081 var simpleEscapeMap = new Array(256);
7082 for (i = 0; i < 256; i++) {
7083 simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
7084 simpleEscapeMap[i] = simpleEscapeSequence(i);
7085 }
7086 var i;
7087 function State$1(input, options) {
7088 this.input = input;
7089 this.filename = options["filename"] || null;
7090 this.schema = options["schema"] || _default;
7091 this.onWarning = options["onWarning"] || null;
7092 this.legacy = options["legacy"] || false;
7093 this.json = options["json"] || false;
7094 this.listener = options["listener"] || null;
7095 this.implicitTypes = this.schema.compiledImplicit;
7096 this.typeMap = this.schema.compiledTypeMap;
7097 this.length = input.length;
7098 this.position = 0;
7099 this.line = 0;
7100 this.lineStart = 0;
7101 this.lineIndent = 0;
7102 this.firstTabInLine = -1;
7103 this.documents = [];
7104 }
7105 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(State$1, "State$1");
7106 function generateError(state, message) {
7107 var mark = {
7108 name: state.filename,
7109 buffer: state.input.slice(0, -1),
7110 // omit trailing \0
7111 position: state.position,
7112 line: state.line,
7113 column: state.position - state.lineStart
7114 };
7115 mark.snippet = snippet(mark);
7116 return new exception(message, mark);
7117 }
7118 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(generateError, "generateError");
7119 function throwError(state, message) {
7120 throw generateError(state, message);
7121 }
7122 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(throwError, "throwError");
7123 function throwWarning(state, message) {
7124 if (state.onWarning) {
7125 state.onWarning.call(null, generateError(state, message));
7126 }
7127 }
7128 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(throwWarning, "throwWarning");
7129 var directiveHandlers = {
7130 YAML: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(function handleYamlDirective(state, name, args) {
7131 var match, major, minor;
7132 if (state.version !== null) {
7133 throwError(state, "duplication of %YAML directive");
7134 }
7135 if (args.length !== 1) {
7136 throwError(state, "YAML directive accepts exactly one argument");
7137 }
7138 match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
7139 if (match === null) {
7140 throwError(state, "ill-formed argument of the YAML directive");
7141 }
7142 major = parseInt(match[1], 10);
7143 minor = parseInt(match[2], 10);
7144 if (major !== 1) {
7145 throwError(state, "unacceptable YAML version of the document");
7146 }
7147 state.version = args[0];
7148 state.checkLineBreaks = minor < 2;
7149 if (minor !== 1 && minor !== 2) {
7150 throwWarning(state, "unsupported YAML version of the document");
7151 }
7152 }, "handleYamlDirective"),
7153 TAG: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(function handleTagDirective(state, name, args) {
7154 var handle, prefix;
7155 if (args.length !== 2) {
7156 throwError(state, "TAG directive accepts exactly two arguments");
7157 }
7158 handle = args[0];
7159 prefix = args[1];
7160 if (!PATTERN_TAG_HANDLE.test(handle)) {
7161 throwError(state, "ill-formed tag handle (first argument) of the TAG directive");
7162 }
7163 if (_hasOwnProperty$1.call(state.tagMap, handle)) {
7164 throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
7165 }
7166 if (!PATTERN_TAG_URI.test(prefix)) {
7167 throwError(state, "ill-formed tag prefix (second argument) of the TAG directive");
7168 }
7169 try {
7170 prefix = decodeURIComponent(prefix);
7171 } catch (err) {
7172 throwError(state, "tag prefix is malformed: " + prefix);
7173 }
7174 state.tagMap[handle] = prefix;
7175 }, "handleTagDirective")
7176 };
7177 function captureSegment(state, start, end, checkJson) {
7178 var _position, _length, _character, _result;
7179 if (start < end) {
7180 _result = state.input.slice(start, end);
7181 if (checkJson) {
7182 for (_position = 0, _length = _result.length; _position < _length; _position += 1) {
7183 _character = _result.charCodeAt(_position);
7184 if (!(_character === 9 || 32 <= _character && _character <= 1114111)) {
7185 throwError(state, "expected valid JSON character");
7186 }
7187 }
7188 } else if (PATTERN_NON_PRINTABLE.test(_result)) {
7189 throwError(state, "the stream contains non-printable characters");
7190 }
7191 state.result += _result;
7192 }
7193 }
7194 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(captureSegment, "captureSegment");
7195 function mergeMappings(state, destination, source, overridableKeys) {
7196 var sourceKeys, key, index, quantity;
7197 if (!common.isObject(source)) {
7198 throwError(state, "cannot merge mappings; the provided source object is unacceptable");
7199 }
7200 sourceKeys = Object.keys(source);
7201 for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
7202 key = sourceKeys[index];
7203 if (!_hasOwnProperty$1.call(destination, key)) {
7204 destination[key] = source[key];
7205 overridableKeys[key] = true;
7206 }
7207 }
7208 }
7209 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(mergeMappings, "mergeMappings");
7210 function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startLineStart, startPos) {
7211 var index, quantity;
7212 if (Array.isArray(keyNode)) {
7213 keyNode = Array.prototype.slice.call(keyNode);
7214 for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {
7215 if (Array.isArray(keyNode[index])) {
7216 throwError(state, "nested arrays are not supported inside keys");
7217 }
7218 if (typeof keyNode === "object" && _class(keyNode[index]) === "[object Object]") {
7219 keyNode[index] = "[object Object]";
7220 }
7221 }
7222 }
7223 if (typeof keyNode === "object" && _class(keyNode) === "[object Object]") {
7224 keyNode = "[object Object]";
7225 }
7226 keyNode = String(keyNode);
7227 if (_result === null) {
7228 _result = {};
7229 }
7230 if (keyTag === "tag:yaml.org,2002:merge") {
7231 if (Array.isArray(valueNode)) {
7232 for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {
7233 mergeMappings(state, _result, valueNode[index], overridableKeys);
7234 }
7235 } else {
7236 mergeMappings(state, _result, valueNode, overridableKeys);
7237 }
7238 } else {
7239 if (!state.json && !_hasOwnProperty$1.call(overridableKeys, keyNode) && _hasOwnProperty$1.call(_result, keyNode)) {
7240 state.line = startLine || state.line;
7241 state.lineStart = startLineStart || state.lineStart;
7242 state.position = startPos || state.position;
7243 throwError(state, "duplicated mapping key");
7244 }
7245 if (keyNode === "__proto__") {
7246 Object.defineProperty(_result, keyNode, {
7247 configurable: true,
7248 enumerable: true,
7249 writable: true,
7250 value: valueNode
7251 });
7252 } else {
7253 _result[keyNode] = valueNode;
7254 }
7255 delete overridableKeys[keyNode];
7256 }
7257 return _result;
7258 }
7259 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(storeMappingPair, "storeMappingPair");
7260 function readLineBreak(state) {
7261 var ch;
7262 ch = state.input.charCodeAt(state.position);
7263 if (ch === 10) {
7264 state.position++;
7265 } else if (ch === 13) {
7266 state.position++;
7267 if (state.input.charCodeAt(state.position) === 10) {
7268 state.position++;
7269 }
7270 } else {
7271 throwError(state, "a line break is expected");
7272 }
7273 state.line += 1;
7274 state.lineStart = state.position;
7275 state.firstTabInLine = -1;
7276 }
7277 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(readLineBreak, "readLineBreak");
7278 function skipSeparationSpace(state, allowComments, checkIndent) {
7279 var lineBreaks = 0, ch = state.input.charCodeAt(state.position);
7280 while (ch !== 0) {
7281 while (is_WHITE_SPACE(ch)) {
7282 if (ch === 9 && state.firstTabInLine === -1) {
7283 state.firstTabInLine = state.position;
7284 }
7285 ch = state.input.charCodeAt(++state.position);
7286 }
7287 if (allowComments && ch === 35) {
7288 do {
7289 ch = state.input.charCodeAt(++state.position);
7290 } while (ch !== 10 && ch !== 13 && ch !== 0);
7291 }
7292 if (is_EOL(ch)) {
7293 readLineBreak(state);
7294 ch = state.input.charCodeAt(state.position);
7295 lineBreaks++;
7296 state.lineIndent = 0;
7297 while (ch === 32) {
7298 state.lineIndent++;
7299 ch = state.input.charCodeAt(++state.position);
7300 }
7301 } else {
7302 break;
7303 }
7304 }
7305 if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {
7306 throwWarning(state, "deficient indentation");
7307 }
7308 return lineBreaks;
7309 }
7310 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(skipSeparationSpace, "skipSeparationSpace");
7311 function testDocumentSeparator(state) {
7312 var _position = state.position, ch;
7313 ch = state.input.charCodeAt(_position);
7314 if ((ch === 45 || ch === 46) && ch === state.input.charCodeAt(_position + 1) && ch === state.input.charCodeAt(_position + 2)) {
7315 _position += 3;
7316 ch = state.input.charCodeAt(_position);
7317 if (ch === 0 || is_WS_OR_EOL(ch)) {
7318 return true;
7319 }
7320 }
7321 return false;
7322 }
7323 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(testDocumentSeparator, "testDocumentSeparator");
7324 function writeFoldedLines(state, count) {
7325 if (count === 1) {
7326 state.result += " ";
7327 } else if (count > 1) {
7328 state.result += common.repeat("\n", count - 1);
7329 }
7330 }
7331 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(writeFoldedLines, "writeFoldedLines");
7332 function readPlainScalar(state, nodeIndent, withinFlowCollection) {
7333 var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state.kind, _result = state.result, ch;
7334 ch = state.input.charCodeAt(state.position);
7335 if (is_WS_OR_EOL(ch) || is_FLOW_INDICATOR(ch) || ch === 35 || ch === 38 || ch === 42 || ch === 33 || ch === 124 || ch === 62 || ch === 39 || ch === 34 || ch === 37 || ch === 64 || ch === 96) {
7336 return false;
7337 }
7338 if (ch === 63 || ch === 45) {
7339 following = state.input.charCodeAt(state.position + 1);
7340 if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
7341 return false;
7342 }
7343 }
7344 state.kind = "scalar";
7345 state.result = "";
7346 captureStart = captureEnd = state.position;
7347 hasPendingContent = false;
7348 while (ch !== 0) {
7349 if (ch === 58) {
7350 following = state.input.charCodeAt(state.position + 1);
7351 if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
7352 break;
7353 }
7354 } else if (ch === 35) {
7355 preceding = state.input.charCodeAt(state.position - 1);
7356 if (is_WS_OR_EOL(preceding)) {
7357 break;
7358 }
7359 } else if (state.position === state.lineStart && testDocumentSeparator(state) || withinFlowCollection && is_FLOW_INDICATOR(ch)) {
7360 break;
7361 } else if (is_EOL(ch)) {
7362 _line = state.line;
7363 _lineStart = state.lineStart;
7364 _lineIndent = state.lineIndent;
7365 skipSeparationSpace(state, false, -1);
7366 if (state.lineIndent >= nodeIndent) {
7367 hasPendingContent = true;
7368 ch = state.input.charCodeAt(state.position);
7369 continue;
7370 } else {
7371 state.position = captureEnd;
7372 state.line = _line;
7373 state.lineStart = _lineStart;
7374 state.lineIndent = _lineIndent;
7375 break;
7376 }
7377 }
7378 if (hasPendingContent) {
7379 captureSegment(state, captureStart, captureEnd, false);
7380 writeFoldedLines(state, state.line - _line);
7381 captureStart = captureEnd = state.position;
7382 hasPendingContent = false;
7383 }
7384 if (!is_WHITE_SPACE(ch)) {
7385 captureEnd = state.position + 1;
7386 }
7387 ch = state.input.charCodeAt(++state.position);
7388 }
7389 captureSegment(state, captureStart, captureEnd, false);
7390 if (state.result) {
7391 return true;
7392 }
7393 state.kind = _kind;
7394 state.result = _result;
7395 return false;
7396 }
7397 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(readPlainScalar, "readPlainScalar");
7398 function readSingleQuotedScalar(state, nodeIndent) {
7399 var ch, captureStart, captureEnd;
7400 ch = state.input.charCodeAt(state.position);
7401 if (ch !== 39) {
7402 return false;
7403 }
7404 state.kind = "scalar";
7405 state.result = "";
7406 state.position++;
7407 captureStart = captureEnd = state.position;
7408 while ((ch = state.input.charCodeAt(state.position)) !== 0) {
7409 if (ch === 39) {
7410 captureSegment(state, captureStart, state.position, true);
7411 ch = state.input.charCodeAt(++state.position);
7412 if (ch === 39) {
7413 captureStart = state.position;
7414 state.position++;
7415 captureEnd = state.position;
7416 } else {
7417 return true;
7418 }
7419 } else if (is_EOL(ch)) {
7420 captureSegment(state, captureStart, captureEnd, true);
7421 writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
7422 captureStart = captureEnd = state.position;
7423 } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
7424 throwError(state, "unexpected end of the document within a single quoted scalar");
7425 } else {
7426 state.position++;
7427 captureEnd = state.position;
7428 }
7429 }
7430 throwError(state, "unexpected end of the stream within a single quoted scalar");
7431 }
7432 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(readSingleQuotedScalar, "readSingleQuotedScalar");
7433 function readDoubleQuotedScalar(state, nodeIndent) {
7434 var captureStart, captureEnd, hexLength, hexResult, tmp, ch;
7435 ch = state.input.charCodeAt(state.position);
7436 if (ch !== 34) {
7437 return false;
7438 }
7439 state.kind = "scalar";
7440 state.result = "";
7441 state.position++;
7442 captureStart = captureEnd = state.position;
7443 while ((ch = state.input.charCodeAt(state.position)) !== 0) {
7444 if (ch === 34) {
7445 captureSegment(state, captureStart, state.position, true);
7446 state.position++;
7447 return true;
7448 } else if (ch === 92) {
7449 captureSegment(state, captureStart, state.position, true);
7450 ch = state.input.charCodeAt(++state.position);
7451 if (is_EOL(ch)) {
7452 skipSeparationSpace(state, false, nodeIndent);
7453 } else if (ch < 256 && simpleEscapeCheck[ch]) {
7454 state.result += simpleEscapeMap[ch];
7455 state.position++;
7456 } else if ((tmp = escapedHexLen(ch)) > 0) {
7457 hexLength = tmp;
7458 hexResult = 0;
7459 for (; hexLength > 0; hexLength--) {
7460 ch = state.input.charCodeAt(++state.position);
7461 if ((tmp = fromHexCode(ch)) >= 0) {
7462 hexResult = (hexResult << 4) + tmp;
7463 } else {
7464 throwError(state, "expected hexadecimal character");
7465 }
7466 }
7467 state.result += charFromCodepoint(hexResult);
7468 state.position++;
7469 } else {
7470 throwError(state, "unknown escape sequence");
7471 }
7472 captureStart = captureEnd = state.position;
7473 } else if (is_EOL(ch)) {
7474 captureSegment(state, captureStart, captureEnd, true);
7475 writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
7476 captureStart = captureEnd = state.position;
7477 } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
7478 throwError(state, "unexpected end of the document within a double quoted scalar");
7479 } else {
7480 state.position++;
7481 captureEnd = state.position;
7482 }
7483 }
7484 throwError(state, "unexpected end of the stream within a double quoted scalar");
7485 }
7486 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(readDoubleQuotedScalar, "readDoubleQuotedScalar");
7487 function readFlowCollection(state, nodeIndent) {
7488 var readNext = true, _line, _lineStart, _pos, _tag = state.tag, _result, _anchor = state.anchor, following, terminator, isPair, isExplicitPair, isMapping, overridableKeys = /* @__PURE__ */ Object.create(null), keyNode, keyTag, valueNode, ch;
7489 ch = state.input.charCodeAt(state.position);
7490 if (ch === 91) {
7491 terminator = 93;
7492 isMapping = false;
7493 _result = [];
7494 } else if (ch === 123) {
7495 terminator = 125;
7496 isMapping = true;
7497 _result = {};
7498 } else {
7499 return false;
7500 }
7501 if (state.anchor !== null) {
7502 state.anchorMap[state.anchor] = _result;
7503 }
7504 ch = state.input.charCodeAt(++state.position);
7505 while (ch !== 0) {
7506 skipSeparationSpace(state, true, nodeIndent);
7507 ch = state.input.charCodeAt(state.position);
7508 if (ch === terminator) {
7509 state.position++;
7510 state.tag = _tag;
7511 state.anchor = _anchor;
7512 state.kind = isMapping ? "mapping" : "sequence";
7513 state.result = _result;
7514 return true;
7515 } else if (!readNext) {
7516 throwError(state, "missed comma between flow collection entries");
7517 } else if (ch === 44) {
7518 throwError(state, "expected the node content, but found ','");
7519 }
7520 keyTag = keyNode = valueNode = null;
7521 isPair = isExplicitPair = false;
7522 if (ch === 63) {
7523 following = state.input.charCodeAt(state.position + 1);
7524 if (is_WS_OR_EOL(following)) {
7525 isPair = isExplicitPair = true;
7526 state.position++;
7527 skipSeparationSpace(state, true, nodeIndent);
7528 }
7529 }
7530 _line = state.line;
7531 _lineStart = state.lineStart;
7532 _pos = state.position;
7533 composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
7534 keyTag = state.tag;
7535 keyNode = state.result;
7536 skipSeparationSpace(state, true, nodeIndent);
7537 ch = state.input.charCodeAt(state.position);
7538 if ((isExplicitPair || state.line === _line) && ch === 58) {
7539 isPair = true;
7540 ch = state.input.charCodeAt(++state.position);
7541 skipSeparationSpace(state, true, nodeIndent);
7542 composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
7543 valueNode = state.result;
7544 }
7545 if (isMapping) {
7546 storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos);
7547 } else if (isPair) {
7548 _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos));
7549 } else {
7550 _result.push(keyNode);
7551 }
7552 skipSeparationSpace(state, true, nodeIndent);
7553 ch = state.input.charCodeAt(state.position);
7554 if (ch === 44) {
7555 readNext = true;
7556 ch = state.input.charCodeAt(++state.position);
7557 } else {
7558 readNext = false;
7559 }
7560 }
7561 throwError(state, "unexpected end of the stream within a flow collection");
7562 }
7563 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(readFlowCollection, "readFlowCollection");
7564 function readBlockScalar(state, nodeIndent) {
7565 var captureStart, folding, chomping = CHOMPING_CLIP, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch;
7566 ch = state.input.charCodeAt(state.position);
7567 if (ch === 124) {
7568 folding = false;
7569 } else if (ch === 62) {
7570 folding = true;
7571 } else {
7572 return false;
7573 }
7574 state.kind = "scalar";
7575 state.result = "";
7576 while (ch !== 0) {
7577 ch = state.input.charCodeAt(++state.position);
7578 if (ch === 43 || ch === 45) {
7579 if (CHOMPING_CLIP === chomping) {
7580 chomping = ch === 43 ? CHOMPING_KEEP : CHOMPING_STRIP;
7581 } else {
7582 throwError(state, "repeat of a chomping mode identifier");
7583 }
7584 } else if ((tmp = fromDecimalCode(ch)) >= 0) {
7585 if (tmp === 0) {
7586 throwError(state, "bad explicit indentation width of a block scalar; it cannot be less than one");
7587 } else if (!detectedIndent) {
7588 textIndent = nodeIndent + tmp - 1;
7589 detectedIndent = true;
7590 } else {
7591 throwError(state, "repeat of an indentation width identifier");
7592 }
7593 } else {
7594 break;
7595 }
7596 }
7597 if (is_WHITE_SPACE(ch)) {
7598 do {
7599 ch = state.input.charCodeAt(++state.position);
7600 } while (is_WHITE_SPACE(ch));
7601 if (ch === 35) {
7602 do {
7603 ch = state.input.charCodeAt(++state.position);
7604 } while (!is_EOL(ch) && ch !== 0);
7605 }
7606 }
7607 while (ch !== 0) {
7608 readLineBreak(state);
7609 state.lineIndent = 0;
7610 ch = state.input.charCodeAt(state.position);
7611 while ((!detectedIndent || state.lineIndent < textIndent) && ch === 32) {
7612 state.lineIndent++;
7613 ch = state.input.charCodeAt(++state.position);
7614 }
7615 if (!detectedIndent && state.lineIndent > textIndent) {
7616 textIndent = state.lineIndent;
7617 }
7618 if (is_EOL(ch)) {
7619 emptyLines++;
7620 continue;
7621 }
7622 if (state.lineIndent < textIndent) {
7623 if (chomping === CHOMPING_KEEP) {
7624 state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
7625 } else if (chomping === CHOMPING_CLIP) {
7626 if (didReadContent) {
7627 state.result += "\n";
7628 }
7629 }
7630 break;
7631 }
7632 if (folding) {
7633 if (is_WHITE_SPACE(ch)) {
7634 atMoreIndented = true;
7635 state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
7636 } else if (atMoreIndented) {
7637 atMoreIndented = false;
7638 state.result += common.repeat("\n", emptyLines + 1);
7639 } else if (emptyLines === 0) {
7640 if (didReadContent) {
7641 state.result += " ";
7642 }
7643 } else {
7644 state.result += common.repeat("\n", emptyLines);
7645 }
7646 } else {
7647 state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
7648 }
7649 didReadContent = true;
7650 detectedIndent = true;
7651 emptyLines = 0;
7652 captureStart = state.position;
7653 while (!is_EOL(ch) && ch !== 0) {
7654 ch = state.input.charCodeAt(++state.position);
7655 }
7656 captureSegment(state, captureStart, state.position, false);
7657 }
7658 return true;
7659 }
7660 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(readBlockScalar, "readBlockScalar");
7661 function readBlockSequence(state, nodeIndent) {
7662 var _line, _tag = state.tag, _anchor = state.anchor, _result = [], following, detected = false, ch;
7663 if (state.firstTabInLine !== -1) return false;
7664 if (state.anchor !== null) {
7665 state.anchorMap[state.anchor] = _result;
7666 }
7667 ch = state.input.charCodeAt(state.position);
7668 while (ch !== 0) {
7669 if (state.firstTabInLine !== -1) {
7670 state.position = state.firstTabInLine;
7671 throwError(state, "tab characters must not be used in indentation");
7672 }
7673 if (ch !== 45) {
7674 break;
7675 }
7676 following = state.input.charCodeAt(state.position + 1);
7677 if (!is_WS_OR_EOL(following)) {
7678 break;
7679 }
7680 detected = true;
7681 state.position++;
7682 if (skipSeparationSpace(state, true, -1)) {
7683 if (state.lineIndent <= nodeIndent) {
7684 _result.push(null);
7685 ch = state.input.charCodeAt(state.position);
7686 continue;
7687 }
7688 }
7689 _line = state.line;
7690 composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
7691 _result.push(state.result);
7692 skipSeparationSpace(state, true, -1);
7693 ch = state.input.charCodeAt(state.position);
7694 if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) {
7695 throwError(state, "bad indentation of a sequence entry");
7696 } else if (state.lineIndent < nodeIndent) {
7697 break;
7698 }
7699 }
7700 if (detected) {
7701 state.tag = _tag;
7702 state.anchor = _anchor;
7703 state.kind = "sequence";
7704 state.result = _result;
7705 return true;
7706 }
7707 return false;
7708 }
7709 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(readBlockSequence, "readBlockSequence");
7710 function readBlockMapping(state, nodeIndent, flowIndent) {
7711 var following, allowCompact, _line, _keyLine, _keyLineStart, _keyPos, _tag = state.tag, _anchor = state.anchor, _result = {}, overridableKeys = /* @__PURE__ */ Object.create(null), keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch;
7712 if (state.firstTabInLine !== -1) return false;
7713 if (state.anchor !== null) {
7714 state.anchorMap[state.anchor] = _result;
7715 }
7716 ch = state.input.charCodeAt(state.position);
7717 while (ch !== 0) {
7718 if (!atExplicitKey && state.firstTabInLine !== -1) {
7719 state.position = state.firstTabInLine;
7720 throwError(state, "tab characters must not be used in indentation");
7721 }
7722 following = state.input.charCodeAt(state.position + 1);
7723 _line = state.line;
7724 if ((ch === 63 || ch === 58) && is_WS_OR_EOL(following)) {
7725 if (ch === 63) {
7726 if (atExplicitKey) {
7727 storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
7728 keyTag = keyNode = valueNode = null;
7729 }
7730 detected = true;
7731 atExplicitKey = true;
7732 allowCompact = true;
7733 } else if (atExplicitKey) {
7734 atExplicitKey = false;
7735 allowCompact = true;
7736 } else {
7737 throwError(state, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");
7738 }
7739 state.position += 1;
7740 ch = following;
7741 } else {
7742 _keyLine = state.line;
7743 _keyLineStart = state.lineStart;
7744 _keyPos = state.position;
7745 if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
7746 break;
7747 }
7748 if (state.line === _line) {
7749 ch = state.input.charCodeAt(state.position);
7750 while (is_WHITE_SPACE(ch)) {
7751 ch = state.input.charCodeAt(++state.position);
7752 }
7753 if (ch === 58) {
7754 ch = state.input.charCodeAt(++state.position);
7755 if (!is_WS_OR_EOL(ch)) {
7756 throwError(state, "a whitespace character is expected after the key-value separator within a block mapping");
7757 }
7758 if (atExplicitKey) {
7759 storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
7760 keyTag = keyNode = valueNode = null;
7761 }
7762 detected = true;
7763 atExplicitKey = false;
7764 allowCompact = false;
7765 keyTag = state.tag;
7766 keyNode = state.result;
7767 } else if (detected) {
7768 throwError(state, "can not read an implicit mapping pair; a colon is missed");
7769 } else {
7770 state.tag = _tag;
7771 state.anchor = _anchor;
7772 return true;
7773 }
7774 } else if (detected) {
7775 throwError(state, "can not read a block mapping entry; a multiline key may not be an implicit key");
7776 } else {
7777 state.tag = _tag;
7778 state.anchor = _anchor;
7779 return true;
7780 }
7781 }
7782 if (state.line === _line || state.lineIndent > nodeIndent) {
7783 if (atExplicitKey) {
7784 _keyLine = state.line;
7785 _keyLineStart = state.lineStart;
7786 _keyPos = state.position;
7787 }
7788 if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
7789 if (atExplicitKey) {
7790 keyNode = state.result;
7791 } else {
7792 valueNode = state.result;
7793 }
7794 }
7795 if (!atExplicitKey) {
7796 storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos);
7797 keyTag = keyNode = valueNode = null;
7798 }
7799 skipSeparationSpace(state, true, -1);
7800 ch = state.input.charCodeAt(state.position);
7801 }
7802 if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) {
7803 throwError(state, "bad indentation of a mapping entry");
7804 } else if (state.lineIndent < nodeIndent) {
7805 break;
7806 }
7807 }
7808 if (atExplicitKey) {
7809 storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
7810 }
7811 if (detected) {
7812 state.tag = _tag;
7813 state.anchor = _anchor;
7814 state.kind = "mapping";
7815 state.result = _result;
7816 }
7817 return detected;
7818 }
7819 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(readBlockMapping, "readBlockMapping");
7820 function readTagProperty(state) {
7821 var _position, isVerbatim = false, isNamed = false, tagHandle, tagName, ch;
7822 ch = state.input.charCodeAt(state.position);
7823 if (ch !== 33) return false;
7824 if (state.tag !== null) {
7825 throwError(state, "duplication of a tag property");
7826 }
7827 ch = state.input.charCodeAt(++state.position);
7828 if (ch === 60) {
7829 isVerbatim = true;
7830 ch = state.input.charCodeAt(++state.position);
7831 } else if (ch === 33) {
7832 isNamed = true;
7833 tagHandle = "!!";
7834 ch = state.input.charCodeAt(++state.position);
7835 } else {
7836 tagHandle = "!";
7837 }
7838 _position = state.position;
7839 if (isVerbatim) {
7840 do {
7841 ch = state.input.charCodeAt(++state.position);
7842 } while (ch !== 0 && ch !== 62);
7843 if (state.position < state.length) {
7844 tagName = state.input.slice(_position, state.position);
7845 ch = state.input.charCodeAt(++state.position);
7846 } else {
7847 throwError(state, "unexpected end of the stream within a verbatim tag");
7848 }
7849 } else {
7850 while (ch !== 0 && !is_WS_OR_EOL(ch)) {
7851 if (ch === 33) {
7852 if (!isNamed) {
7853 tagHandle = state.input.slice(_position - 1, state.position + 1);
7854 if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
7855 throwError(state, "named tag handle cannot contain such characters");
7856 }
7857 isNamed = true;
7858 _position = state.position + 1;
7859 } else {
7860 throwError(state, "tag suffix cannot contain exclamation marks");
7861 }
7862 }
7863 ch = state.input.charCodeAt(++state.position);
7864 }
7865 tagName = state.input.slice(_position, state.position);
7866 if (PATTERN_FLOW_INDICATORS.test(tagName)) {
7867 throwError(state, "tag suffix cannot contain flow indicator characters");
7868 }
7869 }
7870 if (tagName && !PATTERN_TAG_URI.test(tagName)) {
7871 throwError(state, "tag name cannot contain such characters: " + tagName);
7872 }
7873 try {
7874 tagName = decodeURIComponent(tagName);
7875 } catch (err) {
7876 throwError(state, "tag name is malformed: " + tagName);
7877 }
7878 if (isVerbatim) {
7879 state.tag = tagName;
7880 } else if (_hasOwnProperty$1.call(state.tagMap, tagHandle)) {
7881 state.tag = state.tagMap[tagHandle] + tagName;
7882 } else if (tagHandle === "!") {
7883 state.tag = "!" + tagName;
7884 } else if (tagHandle === "!!") {
7885 state.tag = "tag:yaml.org,2002:" + tagName;
7886 } else {
7887 throwError(state, 'undeclared tag handle "' + tagHandle + '"');
7888 }
7889 return true;
7890 }
7891 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(readTagProperty, "readTagProperty");
7892 function readAnchorProperty(state) {
7893 var _position, ch;
7894 ch = state.input.charCodeAt(state.position);
7895 if (ch !== 38) return false;
7896 if (state.anchor !== null) {
7897 throwError(state, "duplication of an anchor property");
7898 }
7899 ch = state.input.charCodeAt(++state.position);
7900 _position = state.position;
7901 while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
7902 ch = state.input.charCodeAt(++state.position);
7903 }
7904 if (state.position === _position) {
7905 throwError(state, "name of an anchor node must contain at least one character");
7906 }
7907 state.anchor = state.input.slice(_position, state.position);
7908 return true;
7909 }
7910 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(readAnchorProperty, "readAnchorProperty");
7911 function readAlias(state) {
7912 var _position, alias, ch;
7913 ch = state.input.charCodeAt(state.position);
7914 if (ch !== 42) return false;
7915 ch = state.input.charCodeAt(++state.position);
7916 _position = state.position;
7917 while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
7918 ch = state.input.charCodeAt(++state.position);
7919 }
7920 if (state.position === _position) {
7921 throwError(state, "name of an alias node must contain at least one character");
7922 }
7923 alias = state.input.slice(_position, state.position);
7924 if (!_hasOwnProperty$1.call(state.anchorMap, alias)) {
7925 throwError(state, 'unidentified alias "' + alias + '"');
7926 }
7927 state.result = state.anchorMap[alias];
7928 skipSeparationSpace(state, true, -1);
7929 return true;
7930 }
7931 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(readAlias, "readAlias");
7932 function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
7933 var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, atNewLine = false, hasContent = false, typeIndex, typeQuantity, typeList, type2, flowIndent, blockIndent;
7934 if (state.listener !== null) {
7935 state.listener("open", state);
7936 }
7937 state.tag = null;
7938 state.anchor = null;
7939 state.kind = null;
7940 state.result = null;
7941 allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT === nodeContext || CONTEXT_BLOCK_IN === nodeContext;
7942 if (allowToSeek) {
7943 if (skipSeparationSpace(state, true, -1)) {
7944 atNewLine = true;
7945 if (state.lineIndent > parentIndent) {
7946 indentStatus = 1;
7947 } else if (state.lineIndent === parentIndent) {
7948 indentStatus = 0;
7949 } else if (state.lineIndent < parentIndent) {
7950 indentStatus = -1;
7951 }
7952 }
7953 }
7954 if (indentStatus === 1) {
7955 while (readTagProperty(state) || readAnchorProperty(state)) {
7956 if (skipSeparationSpace(state, true, -1)) {
7957 atNewLine = true;
7958 allowBlockCollections = allowBlockStyles;
7959 if (state.lineIndent > parentIndent) {
7960 indentStatus = 1;
7961 } else if (state.lineIndent === parentIndent) {
7962 indentStatus = 0;
7963 } else if (state.lineIndent < parentIndent) {
7964 indentStatus = -1;
7965 }
7966 } else {
7967 allowBlockCollections = false;
7968 }
7969 }
7970 }
7971 if (allowBlockCollections) {
7972 allowBlockCollections = atNewLine || allowCompact;
7973 }
7974 if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
7975 if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
7976 flowIndent = parentIndent;
7977 } else {
7978 flowIndent = parentIndent + 1;
7979 }
7980 blockIndent = state.position - state.lineStart;
7981 if (indentStatus === 1) {
7982 if (allowBlockCollections && (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent)) || readFlowCollection(state, flowIndent)) {
7983 hasContent = true;
7984 } else {
7985 if (allowBlockScalars && readBlockScalar(state, flowIndent) || readSingleQuotedScalar(state, flowIndent) || readDoubleQuotedScalar(state, flowIndent)) {
7986 hasContent = true;
7987 } else if (readAlias(state)) {
7988 hasContent = true;
7989 if (state.tag !== null || state.anchor !== null) {
7990 throwError(state, "alias node should not have any properties");
7991 }
7992 } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
7993 hasContent = true;
7994 if (state.tag === null) {
7995 state.tag = "?";
7996 }
7997 }
7998 if (state.anchor !== null) {
7999 state.anchorMap[state.anchor] = state.result;
8000 }
8001 }
8002 } else if (indentStatus === 0) {
8003 hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
8004 }
8005 }
8006 if (state.tag === null) {
8007 if (state.anchor !== null) {
8008 state.anchorMap[state.anchor] = state.result;
8009 }
8010 } else if (state.tag === "?") {
8011 if (state.result !== null && state.kind !== "scalar") {
8012 throwError(state, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + state.kind + '"');
8013 }
8014 for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
8015 type2 = state.implicitTypes[typeIndex];
8016 if (type2.resolve(state.result)) {
8017 state.result = type2.construct(state.result);
8018 state.tag = type2.tag;
8019 if (state.anchor !== null) {
8020 state.anchorMap[state.anchor] = state.result;
8021 }
8022 break;
8023 }
8024 }
8025 } else if (state.tag !== "!") {
8026 if (_hasOwnProperty$1.call(state.typeMap[state.kind || "fallback"], state.tag)) {
8027 type2 = state.typeMap[state.kind || "fallback"][state.tag];
8028 } else {
8029 type2 = null;
8030 typeList = state.typeMap.multi[state.kind || "fallback"];
8031 for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) {
8032 if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {
8033 type2 = typeList[typeIndex];
8034 break;
8035 }
8036 }
8037 }
8038 if (!type2) {
8039 throwError(state, "unknown tag !<" + state.tag + ">");
8040 }
8041 if (state.result !== null && type2.kind !== state.kind) {
8042 throwError(state, "unacceptable node kind for !<" + state.tag + '> tag; it should be "' + type2.kind + '", not "' + state.kind + '"');
8043 }
8044 if (!type2.resolve(state.result, state.tag)) {
8045 throwError(state, "cannot resolve a node with !<" + state.tag + "> explicit tag");
8046 } else {
8047 state.result = type2.construct(state.result, state.tag);
8048 if (state.anchor !== null) {
8049 state.anchorMap[state.anchor] = state.result;
8050 }
8051 }
8052 }
8053 if (state.listener !== null) {
8054 state.listener("close", state);
8055 }
8056 return state.tag !== null || state.anchor !== null || hasContent;
8057 }
8058 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(composeNode, "composeNode");
8059 function readDocument(state) {
8060 var documentStart = state.position, _position, directiveName, directiveArgs, hasDirectives = false, ch;
8061 state.version = null;
8062 state.checkLineBreaks = state.legacy;
8063 state.tagMap = /* @__PURE__ */ Object.create(null);
8064 state.anchorMap = /* @__PURE__ */ Object.create(null);
8065 while ((ch = state.input.charCodeAt(state.position)) !== 0) {
8066 skipSeparationSpace(state, true, -1);
8067 ch = state.input.charCodeAt(state.position);
8068 if (state.lineIndent > 0 || ch !== 37) {
8069 break;
8070 }
8071 hasDirectives = true;
8072 ch = state.input.charCodeAt(++state.position);
8073 _position = state.position;
8074 while (ch !== 0 && !is_WS_OR_EOL(ch)) {
8075 ch = state.input.charCodeAt(++state.position);
8076 }
8077 directiveName = state.input.slice(_position, state.position);
8078 directiveArgs = [];
8079 if (directiveName.length < 1) {
8080 throwError(state, "directive name must not be less than one character in length");
8081 }
8082 while (ch !== 0) {
8083 while (is_WHITE_SPACE(ch)) {
8084 ch = state.input.charCodeAt(++state.position);
8085 }
8086 if (ch === 35) {
8087 do {
8088 ch = state.input.charCodeAt(++state.position);
8089 } while (ch !== 0 && !is_EOL(ch));
8090 break;
8091 }
8092 if (is_EOL(ch)) break;
8093 _position = state.position;
8094 while (ch !== 0 && !is_WS_OR_EOL(ch)) {
8095 ch = state.input.charCodeAt(++state.position);
8096 }
8097 directiveArgs.push(state.input.slice(_position, state.position));
8098 }
8099 if (ch !== 0) readLineBreak(state);
8100 if (_hasOwnProperty$1.call(directiveHandlers, directiveName)) {
8101 directiveHandlers[directiveName](state, directiveName, directiveArgs);
8102 } else {
8103 throwWarning(state, 'unknown document directive "' + directiveName + '"');
8104 }
8105 }
8106 skipSeparationSpace(state, true, -1);
8107 if (state.lineIndent === 0 && state.input.charCodeAt(state.position) === 45 && state.input.charCodeAt(state.position + 1) === 45 && state.input.charCodeAt(state.position + 2) === 45) {
8108 state.position += 3;
8109 skipSeparationSpace(state, true, -1);
8110 } else if (hasDirectives) {
8111 throwError(state, "directives end mark is expected");
8112 }
8113 composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
8114 skipSeparationSpace(state, true, -1);
8115 if (state.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
8116 throwWarning(state, "non-ASCII line breaks are interpreted as content");
8117 }
8118 state.documents.push(state.result);
8119 if (state.position === state.lineStart && testDocumentSeparator(state)) {
8120 if (state.input.charCodeAt(state.position) === 46) {
8121 state.position += 3;
8122 skipSeparationSpace(state, true, -1);
8123 }
8124 return;
8125 }
8126 if (state.position < state.length - 1) {
8127 throwError(state, "end of the stream or a document separator is expected");
8128 } else {
8129 return;
8130 }
8131 }
8132 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(readDocument, "readDocument");
8133 function loadDocuments(input, options) {
8134 input = String(input);
8135 options = options || {};
8136 if (input.length !== 0) {
8137 if (input.charCodeAt(input.length - 1) !== 10 && input.charCodeAt(input.length - 1) !== 13) {
8138 input += "\n";
8139 }
8140 if (input.charCodeAt(0) === 65279) {
8141 input = input.slice(1);
8142 }
8143 }
8144 var state = new State$1(input, options);
8145 var nullpos = input.indexOf("\0");
8146 if (nullpos !== -1) {
8147 state.position = nullpos;
8148 throwError(state, "null byte is not allowed in input");
8149 }
8150 state.input += "\0";
8151 while (state.input.charCodeAt(state.position) === 32) {
8152 state.lineIndent += 1;
8153 state.position += 1;
8154 }
8155 while (state.position < state.length - 1) {
8156 readDocument(state);
8157 }
8158 return state.documents;
8159 }
8160 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(loadDocuments, "loadDocuments");
8161 function loadAll$1(input, iterator, options) {
8162 if (iterator !== null && typeof iterator === "object" && typeof options === "undefined") {
8163 options = iterator;
8164 iterator = null;
8165 }
8166 var documents = loadDocuments(input, options);
8167 if (typeof iterator !== "function") {
8168 return documents;
8169 }
8170 for (var index = 0, length = documents.length; index < length; index += 1) {
8171 iterator(documents[index]);
8172 }
8173 }
8174 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(loadAll$1, "loadAll$1");
8175 function load$1(input, options) {
8176 var documents = loadDocuments(input, options);
8177 if (documents.length === 0) {
8178 return void 0;
8179 } else if (documents.length === 1) {
8180 return documents[0];
8181 }
8182 throw new exception("expected a single document in the stream, but found more");
8183 }
8184 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(load$1, "load$1");
8185 var loadAll_1 = loadAll$1;
8186 var load_1 = load$1;
8187 var loader = {
8188 loadAll: loadAll_1,
8189 load: load_1
8190 };
8191 var _toString = Object.prototype.toString;
8192 var _hasOwnProperty = Object.prototype.hasOwnProperty;
8193 var CHAR_BOM = 65279;
8194 var CHAR_TAB = 9;
8195 var CHAR_LINE_FEED = 10;
8196 var CHAR_CARRIAGE_RETURN = 13;
8197 var CHAR_SPACE = 32;
8198 var CHAR_EXCLAMATION = 33;
8199 var CHAR_DOUBLE_QUOTE = 34;
8200 var CHAR_SHARP = 35;
8201 var CHAR_PERCENT = 37;
8202 var CHAR_AMPERSAND = 38;
8203 var CHAR_SINGLE_QUOTE = 39;
8204 var CHAR_ASTERISK = 42;
8205 var CHAR_COMMA = 44;
8206 var CHAR_MINUS = 45;
8207 var CHAR_COLON = 58;
8208 var CHAR_EQUALS = 61;
8209 var CHAR_GREATER_THAN = 62;
8210 var CHAR_QUESTION = 63;
8211 var CHAR_COMMERCIAL_AT = 64;
8212 var CHAR_LEFT_SQUARE_BRACKET = 91;
8213 var CHAR_RIGHT_SQUARE_BRACKET = 93;
8214 var CHAR_GRAVE_ACCENT = 96;
8215 var CHAR_LEFT_CURLY_BRACKET = 123;
8216 var CHAR_VERTICAL_LINE = 124;
8217 var CHAR_RIGHT_CURLY_BRACKET = 125;
8218 var ESCAPE_SEQUENCES = {};
8219 ESCAPE_SEQUENCES[0] = "\\0";
8220 ESCAPE_SEQUENCES[7] = "\\a";
8221 ESCAPE_SEQUENCES[8] = "\\b";
8222 ESCAPE_SEQUENCES[9] = "\\t";
8223 ESCAPE_SEQUENCES[10] = "\\n";
8224 ESCAPE_SEQUENCES[11] = "\\v";
8225 ESCAPE_SEQUENCES[12] = "\\f";
8226 ESCAPE_SEQUENCES[13] = "\\r";
8227 ESCAPE_SEQUENCES[27] = "\\e";
8228 ESCAPE_SEQUENCES[34] = '\\"';
8229 ESCAPE_SEQUENCES[92] = "\\\\";
8230 ESCAPE_SEQUENCES[133] = "\\N";
8231 ESCAPE_SEQUENCES[160] = "\\_";
8232 ESCAPE_SEQUENCES[8232] = "\\L";
8233 ESCAPE_SEQUENCES[8233] = "\\P";
8234 var DEPRECATED_BOOLEANS_SYNTAX = [
8235 "y",
8236 "Y",
8237 "yes",
8238 "Yes",
8239 "YES",
8240 "on",
8241 "On",
8242 "ON",
8243 "n",
8244 "N",
8245 "no",
8246 "No",
8247 "NO",
8248 "off",
8249 "Off",
8250 "OFF"
8251 ];
8252 var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
8253 function compileStyleMap(schema2, map2) {
8254 var result, keys, index, length, tag, style, type2;
8255 if (map2 === null) return {};
8256 result = {};
8257 keys = Object.keys(map2);
8258 for (index = 0, length = keys.length; index < length; index += 1) {
8259 tag = keys[index];
8260 style = String(map2[tag]);
8261 if (tag.slice(0, 2) === "!!") {
8262 tag = "tag:yaml.org,2002:" + tag.slice(2);
8263 }
8264 type2 = schema2.compiledTypeMap["fallback"][tag];
8265 if (type2 && _hasOwnProperty.call(type2.styleAliases, style)) {
8266 style = type2.styleAliases[style];
8267 }
8268 result[tag] = style;
8269 }
8270 return result;
8271 }
8272 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(compileStyleMap, "compileStyleMap");
8273 function encodeHex(character) {
8274 var string, handle, length;
8275 string = character.toString(16).toUpperCase();
8276 if (character <= 255) {
8277 handle = "x";
8278 length = 2;
8279 } else if (character <= 65535) {
8280 handle = "u";
8281 length = 4;
8282 } else if (character <= 4294967295) {
8283 handle = "U";
8284 length = 8;
8285 } else {
8286 throw new exception("code point within a string may not be greater than 0xFFFFFFFF");
8287 }
8288 return "\\" + handle + common.repeat("0", length - string.length) + string;
8289 }
8290 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(encodeHex, "encodeHex");
8291 var QUOTING_TYPE_SINGLE = 1;
8292 var QUOTING_TYPE_DOUBLE = 2;
8293 function State(options) {
8294 this.schema = options["schema"] || _default;
8295 this.indent = Math.max(1, options["indent"] || 2);
8296 this.noArrayIndent = options["noArrayIndent"] || false;
8297 this.skipInvalid = options["skipInvalid"] || false;
8298 this.flowLevel = common.isNothing(options["flowLevel"]) ? -1 : options["flowLevel"];
8299 this.styleMap = compileStyleMap(this.schema, options["styles"] || null);
8300 this.sortKeys = options["sortKeys"] || false;
8301 this.lineWidth = options["lineWidth"] || 80;
8302 this.noRefs = options["noRefs"] || false;
8303 this.noCompatMode = options["noCompatMode"] || false;
8304 this.condenseFlow = options["condenseFlow"] || false;
8305 this.quotingType = options["quotingType"] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE;
8306 this.forceQuotes = options["forceQuotes"] || false;
8307 this.replacer = typeof options["replacer"] === "function" ? options["replacer"] : null;
8308 this.implicitTypes = this.schema.compiledImplicit;
8309 this.explicitTypes = this.schema.compiledExplicit;
8310 this.tag = null;
8311 this.result = "";
8312 this.duplicates = [];
8313 this.usedDuplicates = null;
8314 }
8315 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(State, "State");
8316 function indentString(string, spaces) {
8317 var ind = common.repeat(" ", spaces), position = 0, next = -1, result = "", line, length = string.length;
8318 while (position < length) {
8319 next = string.indexOf("\n", position);
8320 if (next === -1) {
8321 line = string.slice(position);
8322 position = length;
8323 } else {
8324 line = string.slice(position, next + 1);
8325 position = next + 1;
8326 }
8327 if (line.length && line !== "\n") result += ind;
8328 result += line;
8329 }
8330 return result;
8331 }
8332 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(indentString, "indentString");
8333 function generateNextLine(state, level) {
8334 return "\n" + common.repeat(" ", state.indent * level);
8335 }
8336 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(generateNextLine, "generateNextLine");
8337 function testImplicitResolving(state, str2) {
8338 var index, length, type2;
8339 for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {
8340 type2 = state.implicitTypes[index];
8341 if (type2.resolve(str2)) {
8342 return true;
8343 }
8344 }
8345 return false;
8346 }
8347 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(testImplicitResolving, "testImplicitResolving");
8348 function isWhitespace(c) {
8349 return c === CHAR_SPACE || c === CHAR_TAB;
8350 }
8351 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(isWhitespace, "isWhitespace");
8352 function isPrintable(c) {
8353 return 32 <= c && c <= 126 || 161 <= c && c <= 55295 && c !== 8232 && c !== 8233 || 57344 <= c && c <= 65533 && c !== CHAR_BOM || 65536 <= c && c <= 1114111;
8354 }
8355 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(isPrintable, "isPrintable");
8356 function isNsCharOrWhitespace(c) {
8357 return isPrintable(c) && c !== CHAR_BOM && c !== CHAR_CARRIAGE_RETURN && c !== CHAR_LINE_FEED;
8358 }
8359 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(isNsCharOrWhitespace, "isNsCharOrWhitespace");
8360 function isPlainSafe(c, prev, inblock) {
8361 var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c);
8362 var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c);
8363 return (
8364 // ns-plain-safe
8365 (inblock ? (
8366 // c = flow-in
8367 cIsNsCharOrWhitespace
8368 ) : cIsNsCharOrWhitespace && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET) && c !== CHAR_SHARP && !(prev === CHAR_COLON && !cIsNsChar) || isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP || prev === CHAR_COLON && cIsNsChar
8369 );
8370 }
8371 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(isPlainSafe, "isPlainSafe");
8372 function isPlainSafeFirst(c) {
8373 return isPrintable(c) && c !== CHAR_BOM && !isWhitespace(c) && c !== CHAR_MINUS && c !== CHAR_QUESTION && c !== CHAR_COLON && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET && c !== CHAR_SHARP && c !== CHAR_AMPERSAND && c !== CHAR_ASTERISK && c !== CHAR_EXCLAMATION && c !== CHAR_VERTICAL_LINE && c !== CHAR_EQUALS && c !== CHAR_GREATER_THAN && c !== CHAR_SINGLE_QUOTE && c !== CHAR_DOUBLE_QUOTE && c !== CHAR_PERCENT && c !== CHAR_COMMERCIAL_AT && c !== CHAR_GRAVE_ACCENT;
8374 }
8375 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(isPlainSafeFirst, "isPlainSafeFirst");
8376 function isPlainSafeLast(c) {
8377 return !isWhitespace(c) && c !== CHAR_COLON;
8378 }
8379 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(isPlainSafeLast, "isPlainSafeLast");
8380 function codePointAt(string, pos) {
8381 var first = string.charCodeAt(pos), second;
8382 if (first >= 55296 && first <= 56319 && pos + 1 < string.length) {
8383 second = string.charCodeAt(pos + 1);
8384 if (second >= 56320 && second <= 57343) {
8385 return (first - 55296) * 1024 + second - 56320 + 65536;
8386 }
8387 }
8388 return first;
8389 }
8390 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(codePointAt, "codePointAt");
8391 function needIndentIndicator(string) {
8392 var leadingSpaceRe = /^\n* /;
8393 return leadingSpaceRe.test(string);
8394 }
8395 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(needIndentIndicator, "needIndentIndicator");
8396 var STYLE_PLAIN = 1;
8397 var STYLE_SINGLE = 2;
8398 var STYLE_LITERAL = 3;
8399 var STYLE_FOLDED = 4;
8400 var STYLE_DOUBLE = 5;
8401 function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType, quotingType, forceQuotes, inblock) {
8402 var i;
8403 var char = 0;
8404 var prevChar = null;
8405 var hasLineBreak = false;
8406 var hasFoldableLine = false;
8407 var shouldTrackWidth = lineWidth !== -1;
8408 var previousLineBreak = -1;
8409 var plain = isPlainSafeFirst(codePointAt(string, 0)) && isPlainSafeLast(codePointAt(string, string.length - 1));
8410 if (singleLineOnly || forceQuotes) {
8411 for (i = 0; i < string.length; char >= 65536 ? i += 2 : i++) {
8412 char = codePointAt(string, i);
8413 if (!isPrintable(char)) {
8414 return STYLE_DOUBLE;
8415 }
8416 plain = plain && isPlainSafe(char, prevChar, inblock);
8417 prevChar = char;
8418 }
8419 } else {
8420 for (i = 0; i < string.length; char >= 65536 ? i += 2 : i++) {
8421 char = codePointAt(string, i);
8422 if (char === CHAR_LINE_FEED) {
8423 hasLineBreak = true;
8424 if (shouldTrackWidth) {
8425 hasFoldableLine = hasFoldableLine || // Foldable line = too long, and not more-indented.
8426 i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ";
8427 previousLineBreak = i;
8428 }
8429 } else if (!isPrintable(char)) {
8430 return STYLE_DOUBLE;
8431 }
8432 plain = plain && isPlainSafe(char, prevChar, inblock);
8433 prevChar = char;
8434 }
8435 hasFoldableLine = hasFoldableLine || shouldTrackWidth && (i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ");
8436 }
8437 if (!hasLineBreak && !hasFoldableLine) {
8438 if (plain && !forceQuotes && !testAmbiguousType(string)) {
8439 return STYLE_PLAIN;
8440 }
8441 return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
8442 }
8443 if (indentPerLevel > 9 && needIndentIndicator(string)) {
8444 return STYLE_DOUBLE;
8445 }
8446 if (!forceQuotes) {
8447 return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
8448 }
8449 return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
8450 }
8451 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(chooseScalarStyle, "chooseScalarStyle");
8452 function writeScalar(state, string, level, iskey, inblock) {
8453 state.dump = function() {
8454 if (string.length === 0) {
8455 return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''";
8456 }
8457 if (!state.noCompatMode) {
8458 if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) {
8459 return state.quotingType === QUOTING_TYPE_DOUBLE ? '"' + string + '"' : "'" + string + "'";
8460 }
8461 }
8462 var indent = state.indent * Math.max(1, level);
8463 var lineWidth = state.lineWidth === -1 ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);
8464 var singleLineOnly = iskey || state.flowLevel > -1 && level >= state.flowLevel;
8465 function testAmbiguity(string2) {
8466 return testImplicitResolving(state, string2);
8467 }
8468 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(testAmbiguity, "testAmbiguity");
8469 switch (chooseScalarStyle(
8470 string,
8471 singleLineOnly,
8472 state.indent,
8473 lineWidth,
8474 testAmbiguity,
8475 state.quotingType,
8476 state.forceQuotes && !iskey,
8477 inblock
8478 )) {
8479 case STYLE_PLAIN:
8480 return string;
8481 case STYLE_SINGLE:
8482 return "'" + string.replace(/'/g, "''") + "'";
8483 case STYLE_LITERAL:
8484 return "|" + blockHeader(string, state.indent) + dropEndingNewline(indentString(string, indent));
8485 case STYLE_FOLDED:
8486 return ">" + blockHeader(string, state.indent) + dropEndingNewline(indentString(foldString(string, lineWidth), indent));
8487 case STYLE_DOUBLE:
8488 return '"' + escapeString(string) + '"';
8489 default:
8490 throw new exception("impossible error: invalid scalar style");
8491 }
8492 }();
8493 }
8494 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(writeScalar, "writeScalar");
8495 function blockHeader(string, indentPerLevel) {
8496 var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : "";
8497 var clip = string[string.length - 1] === "\n";
8498 var keep = clip && (string[string.length - 2] === "\n" || string === "\n");
8499 var chomp = keep ? "+" : clip ? "" : "-";
8500 return indentIndicator + chomp + "\n";
8501 }
8502 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(blockHeader, "blockHeader");
8503 function dropEndingNewline(string) {
8504 return string[string.length - 1] === "\n" ? string.slice(0, -1) : string;
8505 }
8506 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(dropEndingNewline, "dropEndingNewline");
8507 function foldString(string, width) {
8508 var lineRe = /(\n+)([^\n]*)/g;
8509 var result = function() {
8510 var nextLF = string.indexOf("\n");
8511 nextLF = nextLF !== -1 ? nextLF : string.length;
8512 lineRe.lastIndex = nextLF;
8513 return foldLine(string.slice(0, nextLF), width);
8514 }();
8515 var prevMoreIndented = string[0] === "\n" || string[0] === " ";
8516 var moreIndented;
8517 var match;
8518 while (match = lineRe.exec(string)) {
8519 var prefix = match[1], line = match[2];
8520 moreIndented = line[0] === " ";
8521 result += prefix + (!prevMoreIndented && !moreIndented && line !== "" ? "\n" : "") + foldLine(line, width);
8522 prevMoreIndented = moreIndented;
8523 }
8524 return result;
8525 }
8526 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(foldString, "foldString");
8527 function foldLine(line, width) {
8528 if (line === "" || line[0] === " ") return line;
8529 var breakRe = / [^ ]/g;
8530 var match;
8531 var start = 0, end, curr = 0, next = 0;
8532 var result = "";
8533 while (match = breakRe.exec(line)) {
8534 next = match.index;
8535 if (next - start > width) {
8536 end = curr > start ? curr : next;
8537 result += "\n" + line.slice(start, end);
8538 start = end + 1;
8539 }
8540 curr = next;
8541 }
8542 result += "\n";
8543 if (line.length - start > width && curr > start) {
8544 result += line.slice(start, curr) + "\n" + line.slice(curr + 1);
8545 } else {
8546 result += line.slice(start);
8547 }
8548 return result.slice(1);
8549 }
8550 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(foldLine, "foldLine");
8551 function escapeString(string) {
8552 var result = "";
8553 var char = 0;
8554 var escapeSeq;
8555 for (var i = 0; i < string.length; char >= 65536 ? i += 2 : i++) {
8556 char = codePointAt(string, i);
8557 escapeSeq = ESCAPE_SEQUENCES[char];
8558 if (!escapeSeq && isPrintable(char)) {
8559 result += string[i];
8560 if (char >= 65536) result += string[i + 1];
8561 } else {
8562 result += escapeSeq || encodeHex(char);
8563 }
8564 }
8565 return result;
8566 }
8567 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(escapeString, "escapeString");
8568 function writeFlowSequence(state, level, object) {
8569 var _result = "", _tag = state.tag, index, length, value;
8570 for (index = 0, length = object.length; index < length; index += 1) {
8571 value = object[index];
8572 if (state.replacer) {
8573 value = state.replacer.call(object, String(index), value);
8574 }
8575 if (writeNode(state, level, value, false, false) || typeof value === "undefined" && writeNode(state, level, null, false, false)) {
8576 if (_result !== "") _result += "," + (!state.condenseFlow ? " " : "");
8577 _result += state.dump;
8578 }
8579 }
8580 state.tag = _tag;
8581 state.dump = "[" + _result + "]";
8582 }
8583 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(writeFlowSequence, "writeFlowSequence");
8584 function writeBlockSequence(state, level, object, compact) {
8585 var _result = "", _tag = state.tag, index, length, value;
8586 for (index = 0, length = object.length; index < length; index += 1) {
8587 value = object[index];
8588 if (state.replacer) {
8589 value = state.replacer.call(object, String(index), value);
8590 }
8591 if (writeNode(state, level + 1, value, true, true, false, true) || typeof value === "undefined" && writeNode(state, level + 1, null, true, true, false, true)) {
8592 if (!compact || _result !== "") {
8593 _result += generateNextLine(state, level);
8594 }
8595 if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
8596 _result += "-";
8597 } else {
8598 _result += "- ";
8599 }
8600 _result += state.dump;
8601 }
8602 }
8603 state.tag = _tag;
8604 state.dump = _result || "[]";
8605 }
8606 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(writeBlockSequence, "writeBlockSequence");
8607 function writeFlowMapping(state, level, object) {
8608 var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, pairBuffer;
8609 for (index = 0, length = objectKeyList.length; index < length; index += 1) {
8610 pairBuffer = "";
8611 if (_result !== "") pairBuffer += ", ";
8612 if (state.condenseFlow) pairBuffer += '"';
8613 objectKey = objectKeyList[index];
8614 objectValue = object[objectKey];
8615 if (state.replacer) {
8616 objectValue = state.replacer.call(object, objectKey, objectValue);
8617 }
8618 if (!writeNode(state, level, objectKey, false, false)) {
8619 continue;
8620 }
8621 if (state.dump.length > 1024) pairBuffer += "? ";
8622 pairBuffer += state.dump + (state.condenseFlow ? '"' : "") + ":" + (state.condenseFlow ? "" : " ");
8623 if (!writeNode(state, level, objectValue, false, false)) {
8624 continue;
8625 }
8626 pairBuffer += state.dump;
8627 _result += pairBuffer;
8628 }
8629 state.tag = _tag;
8630 state.dump = "{" + _result + "}";
8631 }
8632 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(writeFlowMapping, "writeFlowMapping");
8633 function writeBlockMapping(state, level, object, compact) {
8634 var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, explicitPair, pairBuffer;
8635 if (state.sortKeys === true) {
8636 objectKeyList.sort();
8637 } else if (typeof state.sortKeys === "function") {
8638 objectKeyList.sort(state.sortKeys);
8639 } else if (state.sortKeys) {
8640 throw new exception("sortKeys must be a boolean or a function");
8641 }
8642 for (index = 0, length = objectKeyList.length; index < length; index += 1) {
8643 pairBuffer = "";
8644 if (!compact || _result !== "") {
8645 pairBuffer += generateNextLine(state, level);
8646 }
8647 objectKey = objectKeyList[index];
8648 objectValue = object[objectKey];
8649 if (state.replacer) {
8650 objectValue = state.replacer.call(object, objectKey, objectValue);
8651 }
8652 if (!writeNode(state, level + 1, objectKey, true, true, true)) {
8653 continue;
8654 }
8655 explicitPair = state.tag !== null && state.tag !== "?" || state.dump && state.dump.length > 1024;
8656 if (explicitPair) {
8657 if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
8658 pairBuffer += "?";
8659 } else {
8660 pairBuffer += "? ";
8661 }
8662 }
8663 pairBuffer += state.dump;
8664 if (explicitPair) {
8665 pairBuffer += generateNextLine(state, level);
8666 }
8667 if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
8668 continue;
8669 }
8670 if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
8671 pairBuffer += ":";
8672 } else {
8673 pairBuffer += ": ";
8674 }
8675 pairBuffer += state.dump;
8676 _result += pairBuffer;
8677 }
8678 state.tag = _tag;
8679 state.dump = _result || "{}";
8680 }
8681 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(writeBlockMapping, "writeBlockMapping");
8682 function detectType(state, object, explicit) {
8683 var _result, typeList, index, length, type2, style;
8684 typeList = explicit ? state.explicitTypes : state.implicitTypes;
8685 for (index = 0, length = typeList.length; index < length; index += 1) {
8686 type2 = typeList[index];
8687 if ((type2.instanceOf || type2.predicate) && (!type2.instanceOf || typeof object === "object" && object instanceof type2.instanceOf) && (!type2.predicate || type2.predicate(object))) {
8688 if (explicit) {
8689 if (type2.multi && type2.representName) {
8690 state.tag = type2.representName(object);
8691 } else {
8692 state.tag = type2.tag;
8693 }
8694 } else {
8695 state.tag = "?";
8696 }
8697 if (type2.represent) {
8698 style = state.styleMap[type2.tag] || type2.defaultStyle;
8699 if (_toString.call(type2.represent) === "[object Function]") {
8700 _result = type2.represent(object, style);
8701 } else if (_hasOwnProperty.call(type2.represent, style)) {
8702 _result = type2.represent[style](object, style);
8703 } else {
8704 throw new exception("!<" + type2.tag + '> tag resolver accepts not "' + style + '" style');
8705 }
8706 state.dump = _result;
8707 }
8708 return true;
8709 }
8710 }
8711 return false;
8712 }
8713 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(detectType, "detectType");
8714 function writeNode(state, level, object, block, compact, iskey, isblockseq) {
8715 state.tag = null;
8716 state.dump = object;
8717 if (!detectType(state, object, false)) {
8718 detectType(state, object, true);
8719 }
8720 var type2 = _toString.call(state.dump);
8721 var inblock = block;
8722 var tagStr;
8723 if (block) {
8724 block = state.flowLevel < 0 || state.flowLevel > level;
8725 }
8726 var objectOrArray = type2 === "[object Object]" || type2 === "[object Array]", duplicateIndex, duplicate;
8727 if (objectOrArray) {
8728 duplicateIndex = state.duplicates.indexOf(object);
8729 duplicate = duplicateIndex !== -1;
8730 }
8731 if (state.tag !== null && state.tag !== "?" || duplicate || state.indent !== 2 && level > 0) {
8732 compact = false;
8733 }
8734 if (duplicate && state.usedDuplicates[duplicateIndex]) {
8735 state.dump = "*ref_" + duplicateIndex;
8736 } else {
8737 if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {
8738 state.usedDuplicates[duplicateIndex] = true;
8739 }
8740 if (type2 === "[object Object]") {
8741 if (block && Object.keys(state.dump).length !== 0) {
8742 writeBlockMapping(state, level, state.dump, compact);
8743 if (duplicate) {
8744 state.dump = "&ref_" + duplicateIndex + state.dump;
8745 }
8746 } else {
8747 writeFlowMapping(state, level, state.dump);
8748 if (duplicate) {
8749 state.dump = "&ref_" + duplicateIndex + " " + state.dump;
8750 }
8751 }
8752 } else if (type2 === "[object Array]") {
8753 if (block && state.dump.length !== 0) {
8754 if (state.noArrayIndent && !isblockseq && level > 0) {
8755 writeBlockSequence(state, level - 1, state.dump, compact);
8756 } else {
8757 writeBlockSequence(state, level, state.dump, compact);
8758 }
8759 if (duplicate) {
8760 state.dump = "&ref_" + duplicateIndex + state.dump;
8761 }
8762 } else {
8763 writeFlowSequence(state, level, state.dump);
8764 if (duplicate) {
8765 state.dump = "&ref_" + duplicateIndex + " " + state.dump;
8766 }
8767 }
8768 } else if (type2 === "[object String]") {
8769 if (state.tag !== "?") {
8770 writeScalar(state, state.dump, level, iskey, inblock);
8771 }
8772 } else if (type2 === "[object Undefined]") {
8773 return false;
8774 } else {
8775 if (state.skipInvalid) return false;
8776 throw new exception("unacceptable kind of an object to dump " + type2);
8777 }
8778 if (state.tag !== null && state.tag !== "?") {
8779 tagStr = encodeURI(
8780 state.tag[0] === "!" ? state.tag.slice(1) : state.tag
8781 ).replace(/!/g, "%21");
8782 if (state.tag[0] === "!") {
8783 tagStr = "!" + tagStr;
8784 } else if (tagStr.slice(0, 18) === "tag:yaml.org,2002:") {
8785 tagStr = "!!" + tagStr.slice(18);
8786 } else {
8787 tagStr = "!<" + tagStr + ">";
8788 }
8789 state.dump = tagStr + " " + state.dump;
8790 }
8791 }
8792 return true;
8793 }
8794 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(writeNode, "writeNode");
8795 function getDuplicateReferences(object, state) {
8796 var objects = [], duplicatesIndexes = [], index, length;
8797 inspectNode(object, objects, duplicatesIndexes);
8798 for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {
8799 state.duplicates.push(objects[duplicatesIndexes[index]]);
8800 }
8801 state.usedDuplicates = new Array(length);
8802 }
8803 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(getDuplicateReferences, "getDuplicateReferences");
8804 function inspectNode(object, objects, duplicatesIndexes) {
8805 var objectKeyList, index, length;
8806 if (object !== null && typeof object === "object") {
8807 index = objects.indexOf(object);
8808 if (index !== -1) {
8809 if (duplicatesIndexes.indexOf(index) === -1) {
8810 duplicatesIndexes.push(index);
8811 }
8812 } else {
8813 objects.push(object);
8814 if (Array.isArray(object)) {
8815 for (index = 0, length = object.length; index < length; index += 1) {
8816 inspectNode(object[index], objects, duplicatesIndexes);
8817 }
8818 } else {
8819 objectKeyList = Object.keys(object);
8820 for (index = 0, length = objectKeyList.length; index < length; index += 1) {
8821 inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
8822 }
8823 }
8824 }
8825 }
8826 }
8827 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(inspectNode, "inspectNode");
8828 function dump$1(input, options) {
8829 options = options || {};
8830 var state = new State(options);
8831 if (!state.noRefs) getDuplicateReferences(input, state);
8832 var value = input;
8833 if (state.replacer) {
8834 value = state.replacer.call({ "": value }, "", value);
8835 }
8836 if (writeNode(state, 0, value, true, true)) return state.dump + "\n";
8837 return "";
8838 }
8839 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(dump$1, "dump$1");
8840 var dump_1 = dump$1;
8841 var dumper = {
8842 dump: dump_1
8843 };
8844 function renamed(from, to) {
8845 return function() {
8846 throw new Error("Function yaml." + from + " is removed in js-yaml 4. Use yaml." + to + " instead, which is now safe by default.");
8847 };
8848 }
8849 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(renamed, "renamed");
8850 var JSON_SCHEMA = json;
8851 var load = loader.load;
8852 var loadAll = loader.loadAll;
8853 var dump = dumper.dump;
8854 var safeLoad = renamed("safeLoad", "load");
8855 var safeLoadAll = renamed("safeLoadAll", "loadAll");
8856 var safeDump = renamed("safeDump", "dump");
8857
8858
8859 /*! Bundled license information:
8860
8861 js-yaml/dist/js-yaml.mjs:
8862 (*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT *)
8863 */
8864
8865
8866 /***/ }),
8867
8868 /***/ 30103:
8869 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8870
8871 "use strict";
8872 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8873 /* harmony export */ P: () => (/* binding */ selectSvgElement)
8874 /* harmony export */ });
8875 /* harmony import */ var _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(86906);
8876 /* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(83619);
8877
8878
8879 // src/rendering-util/selectSvgElement.ts
8880
8881 var selectSvgElement = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)((id) => {
8882 const { securityLevel } = (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .getConfig2 */ .nV)();
8883 let root = (0,d3__WEBPACK_IMPORTED_MODULE_1__/* .select */ .Ys)("body");
8884 if (securityLevel === "sandbox") {
8885 const sandboxElement = (0,d3__WEBPACK_IMPORTED_MODULE_1__/* .select */ .Ys)(`#i${id}`);
8886 const doc = sandboxElement.node()?.contentDocument ?? document;
8887 root = (0,d3__WEBPACK_IMPORTED_MODULE_1__/* .select */ .Ys)(doc.body);
8888 }
8889 const svg = root.select(`#${id}`);
8890 return svg;
8891 }, "selectSvgElement");
8892
8893
8894
8895
8896 /***/ }),
8897
8898 /***/ 39769:
8899 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8900
8901 "use strict";
8902 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8903 /* harmony export */ EY: () => (/* binding */ replaceIconSubstring),
8904 /* harmony export */ QA: () => (/* binding */ computeDimensionOfText),
8905 /* harmony export */ rw: () => (/* binding */ createText)
8906 /* harmony export */ });
8907 /* harmony import */ var _chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(42626);
8908 /* harmony import */ var _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(86906);
8909 /* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(83619);
8910 /* harmony import */ var marked__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(50725);
8911 /* harmony import */ var marked__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(marked__WEBPACK_IMPORTED_MODULE_3__);
8912 /* harmony import */ var ts_dedent__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(11464);
8913
8914
8915
8916 // src/rendering-util/createText.ts
8917
8918
8919 // src/rendering-util/handle-markdown-text.ts
8920
8921
8922 function preprocessMarkdown(markdown, { markdownAutoWrap }) {
8923 const withoutBR = markdown.replace(/<br\/>/g, "\n");
8924 const withoutMultipleNewlines = withoutBR.replace(/\n{2,}/g, "\n");
8925 const withoutExtraSpaces = (0,ts_dedent__WEBPACK_IMPORTED_MODULE_4__/* .dedent */ .Z)(withoutMultipleNewlines);
8926 if (markdownAutoWrap === false) {
8927 return withoutExtraSpaces.replace(/ /g, " ");
8928 }
8929 return withoutExtraSpaces;
8930 }
8931 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_1__/* .__name */ .eW)(preprocessMarkdown, "preprocessMarkdown");
8932 function markdownToLines(markdown, config = {}) {
8933 const preprocessedMarkdown = preprocessMarkdown(markdown, config);
8934 const nodes = marked__WEBPACK_IMPORTED_MODULE_3__.marked.lexer(preprocessedMarkdown);
8935 const lines = [[]];
8936 let currentLine = 0;
8937 function processNode(node, parentType = "normal") {
8938 if (node.type === "text") {
8939 const textLines = node.text.split("\n");
8940 textLines.forEach((textLine, index) => {
8941 if (index !== 0) {
8942 currentLine++;
8943 lines.push([]);
8944 }
8945 textLine.split(" ").forEach((word) => {
8946 word = word.replace(/'/g, `'`);
8947 if (word) {
8948 lines[currentLine].push({ content: word, type: parentType });
8949 }
8950 });
8951 });
8952 } else if (node.type === "strong" || node.type === "em") {
8953 node.tokens.forEach((contentNode) => {
8954 processNode(contentNode, node.type);
8955 });
8956 } else if (node.type === "html") {
8957 lines[currentLine].push({ content: node.text, type: "normal" });
8958 }
8959 }
8960 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_1__/* .__name */ .eW)(processNode, "processNode");
8961 nodes.forEach((treeNode) => {
8962 if (treeNode.type === "paragraph") {
8963 treeNode.tokens?.forEach((contentNode) => {
8964 processNode(contentNode);
8965 });
8966 } else if (treeNode.type === "html") {
8967 lines[currentLine].push({ content: treeNode.text, type: "normal" });
8968 }
8969 });
8970 return lines;
8971 }
8972 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_1__/* .__name */ .eW)(markdownToLines, "markdownToLines");
8973 function markdownToHTML(markdown, { markdownAutoWrap } = {}) {
8974 const nodes = marked__WEBPACK_IMPORTED_MODULE_3__.marked.lexer(markdown);
8975 function output(node) {
8976 if (node.type === "text") {
8977 if (markdownAutoWrap === false) {
8978 return node.text.replace(/\n */g, "<br/>").replace(/ /g, " ");
8979 }
8980 return node.text.replace(/\n */g, "<br/>");
8981 } else if (node.type === "strong") {
8982 return `<strong>${node.tokens?.map(output).join("")}</strong>`;
8983 } else if (node.type === "em") {
8984 return `<em>${node.tokens?.map(output).join("")}</em>`;
8985 } else if (node.type === "paragraph") {
8986 return `<p>${node.tokens?.map(output).join("")}</p>`;
8987 } else if (node.type === "space") {
8988 return "";
8989 } else if (node.type === "html") {
8990 return `${node.text}`;
8991 } else if (node.type === "escape") {
8992 return node.text;
8993 }
8994 return `Unsupported markdown: ${node.type}`;
8995 }
8996 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_1__/* .__name */ .eW)(output, "output");
8997 return nodes.map(output).join("");
8998 }
8999 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_1__/* .__name */ .eW)(markdownToHTML, "markdownToHTML");
9000
9001 // src/rendering-util/splitText.ts
9002 function splitTextToChars(text) {
9003 if (Intl.Segmenter) {
9004 return [...new Intl.Segmenter().segment(text)].map((s) => s.segment);
9005 }
9006 return [...text];
9007 }
9008 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_1__/* .__name */ .eW)(splitTextToChars, "splitTextToChars");
9009 function splitWordToFitWidth(checkFit, word) {
9010 const characters = splitTextToChars(word.content);
9011 return splitWordToFitWidthRecursion(checkFit, [], characters, word.type);
9012 }
9013 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_1__/* .__name */ .eW)(splitWordToFitWidth, "splitWordToFitWidth");
9014 function splitWordToFitWidthRecursion(checkFit, usedChars, remainingChars, type) {
9015 if (remainingChars.length === 0) {
9016 return [
9017 { content: usedChars.join(""), type },
9018 { content: "", type }
9019 ];
9020 }
9021 const [nextChar, ...rest] = remainingChars;
9022 const newWord = [...usedChars, nextChar];
9023 if (checkFit([{ content: newWord.join(""), type }])) {
9024 return splitWordToFitWidthRecursion(checkFit, newWord, rest, type);
9025 }
9026 if (usedChars.length === 0 && nextChar) {
9027 usedChars.push(nextChar);
9028 remainingChars.shift();
9029 }
9030 return [
9031 { content: usedChars.join(""), type },
9032 { content: remainingChars.join(""), type }
9033 ];
9034 }
9035 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_1__/* .__name */ .eW)(splitWordToFitWidthRecursion, "splitWordToFitWidthRecursion");
9036 function splitLineToFitWidth(line, checkFit) {
9037 if (line.some(({ content }) => content.includes("\n"))) {
9038 throw new Error("splitLineToFitWidth does not support newlines in the line");
9039 }
9040 return splitLineToFitWidthRecursion(line, checkFit);
9041 }
9042 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_1__/* .__name */ .eW)(splitLineToFitWidth, "splitLineToFitWidth");
9043 function splitLineToFitWidthRecursion(words, checkFit, lines = [], newLine = []) {
9044 if (words.length === 0) {
9045 if (newLine.length > 0) {
9046 lines.push(newLine);
9047 }
9048 return lines.length > 0 ? lines : [];
9049 }
9050 let joiner = "";
9051 if (words[0].content === " ") {
9052 joiner = " ";
9053 words.shift();
9054 }
9055 const nextWord = words.shift() ?? { content: " ", type: "normal" };
9056 const lineWithNextWord = [...newLine];
9057 if (joiner !== "") {
9058 lineWithNextWord.push({ content: joiner, type: "normal" });
9059 }
9060 lineWithNextWord.push(nextWord);
9061 if (checkFit(lineWithNextWord)) {
9062 return splitLineToFitWidthRecursion(words, checkFit, lines, lineWithNextWord);
9063 }
9064 if (newLine.length > 0) {
9065 lines.push(newLine);
9066 words.unshift(nextWord);
9067 } else if (nextWord.content) {
9068 const [line, rest] = splitWordToFitWidth(checkFit, nextWord);
9069 lines.push([line]);
9070 if (rest.content) {
9071 words.unshift(rest);
9072 }
9073 }
9074 return splitLineToFitWidthRecursion(words, checkFit, lines);
9075 }
9076 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_1__/* .__name */ .eW)(splitLineToFitWidthRecursion, "splitLineToFitWidthRecursion");
9077
9078 // src/rendering-util/createText.ts
9079 function applyStyle(dom, styleFn) {
9080 if (styleFn) {
9081 dom.attr("style", styleFn);
9082 }
9083 }
9084 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_1__/* .__name */ .eW)(applyStyle, "applyStyle");
9085 async function addHtmlSpan(element, node, width, classes, addBackground = false) {
9086 const fo = element.append("foreignObject");
9087 fo.attr("width", `${10 * width}px`);
9088 fo.attr("height", `${10 * width}px`);
9089 const div = fo.append("xhtml:div");
9090 let label = node.label;
9091 if (node.label && (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_1__/* .hasKatex */ .l0)(node.label)) {
9092 label = await (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_1__/* .renderKatex */ .uT)(node.label.replace(_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_1__/* .common_default */ .SY.lineBreakRegex, "\n"), (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_1__/* .getConfig2 */ .nV)());
9093 }
9094 const labelClass = node.isNode ? "nodeLabel" : "edgeLabel";
9095 const span = div.append("span");
9096 span.html(label);
9097 applyStyle(span, node.labelStyle);
9098 span.attr("class", `${labelClass} ${classes}`);
9099 applyStyle(div, node.labelStyle);
9100 div.style("display", "table-cell");
9101 div.style("white-space", "nowrap");
9102 div.style("line-height", "1.5");
9103 div.style("max-width", width + "px");
9104 div.style("text-align", "center");
9105 div.attr("xmlns", "http://www.w3.org/1999/xhtml");
9106 if (addBackground) {
9107 div.attr("class", "labelBkg");
9108 }
9109 let bbox = div.node().getBoundingClientRect();
9110 if (bbox.width === width) {
9111 div.style("display", "table");
9112 div.style("white-space", "break-spaces");
9113 div.style("width", width + "px");
9114 bbox = div.node().getBoundingClientRect();
9115 }
9116 return fo.node();
9117 }
9118 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_1__/* .__name */ .eW)(addHtmlSpan, "addHtmlSpan");
9119 function createTspan(textElement, lineIndex, lineHeight) {
9120 return textElement.append("tspan").attr("class", "text-outer-tspan").attr("x", 0).attr("y", lineIndex * lineHeight - 0.1 + "em").attr("dy", lineHeight + "em");
9121 }
9122 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_1__/* .__name */ .eW)(createTspan, "createTspan");
9123 function computeWidthOfText(parentNode, lineHeight, line) {
9124 const testElement = parentNode.append("text");
9125 const testSpan = createTspan(testElement, 1, lineHeight);
9126 updateTextContentAndStyles(testSpan, line);
9127 const textLength = testSpan.node().getComputedTextLength();
9128 testElement.remove();
9129 return textLength;
9130 }
9131 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_1__/* .__name */ .eW)(computeWidthOfText, "computeWidthOfText");
9132 function computeDimensionOfText(parentNode, lineHeight, text) {
9133 const testElement = parentNode.append("text");
9134 const testSpan = createTspan(testElement, 1, lineHeight);
9135 updateTextContentAndStyles(testSpan, [{ content: text, type: "normal" }]);
9136 const textDimension = testSpan.node()?.getBoundingClientRect();
9137 if (textDimension) {
9138 testElement.remove();
9139 }
9140 return textDimension;
9141 }
9142 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_1__/* .__name */ .eW)(computeDimensionOfText, "computeDimensionOfText");
9143 function createFormattedText(width, g, structuredText, addBackground = false) {
9144 const lineHeight = 1.1;
9145 const labelGroup = g.append("g");
9146 const bkg = labelGroup.insert("rect").attr("class", "background").attr("style", "stroke: none");
9147 const textElement = labelGroup.append("text").attr("y", "-10.1");
9148 let lineIndex = 0;
9149 for (const line of structuredText) {
9150 const checkWidth = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_1__/* .__name */ .eW)((line2) => computeWidthOfText(labelGroup, lineHeight, line2) <= width, "checkWidth");
9151 const linesUnderWidth = checkWidth(line) ? [line] : splitLineToFitWidth(line, checkWidth);
9152 for (const preparedLine of linesUnderWidth) {
9153 const tspan = createTspan(textElement, lineIndex, lineHeight);
9154 updateTextContentAndStyles(tspan, preparedLine);
9155 lineIndex++;
9156 }
9157 }
9158 if (addBackground) {
9159 const bbox = textElement.node().getBBox();
9160 const padding = 2;
9161 bkg.attr("x", bbox.x - padding).attr("y", bbox.y - padding).attr("width", bbox.width + 2 * padding).attr("height", bbox.height + 2 * padding);
9162 return labelGroup.node();
9163 } else {
9164 return textElement.node();
9165 }
9166 }
9167 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_1__/* .__name */ .eW)(createFormattedText, "createFormattedText");
9168 function updateTextContentAndStyles(tspan, wrappedLine) {
9169 tspan.text("");
9170 wrappedLine.forEach((word, index) => {
9171 const innerTspan = tspan.append("tspan").attr("font-style", word.type === "em" ? "italic" : "normal").attr("class", "text-inner-tspan").attr("font-weight", word.type === "strong" ? "bold" : "normal");
9172 if (index === 0) {
9173 innerTspan.text(word.content);
9174 } else {
9175 innerTspan.text(" " + word.content);
9176 }
9177 });
9178 }
9179 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_1__/* .__name */ .eW)(updateTextContentAndStyles, "updateTextContentAndStyles");
9180 function replaceIconSubstring(text) {
9181 return text.replace(
9182 /fa[bklrs]?:fa-[\w-]+/g,
9183 // cspell: disable-line
9184 (s) => `<i class='${s.replace(":", " ")}'></i>`
9185 );
9186 }
9187 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_1__/* .__name */ .eW)(replaceIconSubstring, "replaceIconSubstring");
9188 var createText = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_1__/* .__name */ .eW)(async (el, text = "", {
9189 style = "",
9190 isTitle = false,
9191 classes = "",
9192 useHtmlLabels = true,
9193 isNode = true,
9194 width = 200,
9195 addSvgBackground = false
9196 } = {}, config) => {
9197 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_1__/* .log */ .cM.debug(
9198 "XYZ createText",
9199 text,
9200 style,
9201 isTitle,
9202 classes,
9203 useHtmlLabels,
9204 isNode,
9205 "addSvgBackground: ",
9206 addSvgBackground
9207 );
9208 if (useHtmlLabels) {
9209 const htmlText = markdownToHTML(text, config);
9210 const decodedReplacedText = replaceIconSubstring((0,_chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .decodeEntities */ .SH)(htmlText));
9211 const inputForKatex = text.replace(/\\\\/g, "\\");
9212 const node = {
9213 isNode,
9214 label: (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_1__/* .hasKatex */ .l0)(text) ? inputForKatex : decodedReplacedText,
9215 labelStyle: style.replace("fill:", "color:")
9216 };
9217 const vertexNode = await addHtmlSpan(el, node, width, classes, addSvgBackground);
9218 return vertexNode;
9219 } else {
9220 const sanitizeBR = text.replace(/<br\s*\/?>/g, "<br/>");
9221 const structuredText = markdownToLines(sanitizeBR.replace("<br>", "<br/>"), config);
9222 const svgLabel = createFormattedText(
9223 width,
9224 el,
9225 structuredText,
9226 text ? addSvgBackground : false
9227 );
9228 if (isNode) {
9229 if (/stroke:/.exec(style)) {
9230 style = style.replace("stroke:", "lineColor:");
9231 }
9232 const nodeLabelTextStyle = style.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/color:/g, "fill:");
9233 (0,d3__WEBPACK_IMPORTED_MODULE_2__/* .select */ .Ys)(svgLabel).attr("style", nodeLabelTextStyle);
9234 } else {
9235 const edgeLabelRectStyle = style.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/background:/g, "fill:");
9236 (0,d3__WEBPACK_IMPORTED_MODULE_2__/* .select */ .Ys)(svgLabel).select("rect").attr("style", edgeLabelRectStyle.replace(/background:/g, "fill:"));
9237 const edgeLabelTextStyle = style.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/color:/g, "fill:");
9238 (0,d3__WEBPACK_IMPORTED_MODULE_2__/* .select */ .Ys)(svgLabel).select("text").attr("style", edgeLabelTextStyle);
9239 }
9240 return svgLabel;
9241 }
9242 }, "createText");
9243
9244
9245
9246
9247 /***/ }),
9248
9249 /***/ 62072:
9250 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
9251
9252 "use strict";
9253
9254 // EXPORTS
9255 __webpack_require__.d(__webpack_exports__, {
9256 s4: () => (/* binding */ getIconSVG),
9257 ef: () => (/* binding */ registerIconPacks),
9258 cN: () => (/* binding */ unknownIcon)
9259 });
9260
9261 // EXTERNAL MODULE: ../node_modules/mermaid/dist/chunks/mermaid.core/chunk-YTJNT7DU.mjs + 3 modules
9262 var chunk_YTJNT7DU = __webpack_require__(86906);
9263 ;// CONCATENATED MODULE: ../node_modules/@iconify/utils/lib/icon/name.mjs
9264 const matchIconName = /^[a-z0-9]+(-[a-z0-9]+)*$/;
9265 const stringToIcon = (value, validate, allowSimpleName, provider = "") => {
9266 const colonSeparated = value.split(":");
9267 if (value.slice(0, 1) === "@") {
9268 if (colonSeparated.length < 2 || colonSeparated.length > 3) {
9269 return null;
9270 }
9271 provider = colonSeparated.shift().slice(1);
9272 }
9273 if (colonSeparated.length > 3 || !colonSeparated.length) {
9274 return null;
9275 }
9276 if (colonSeparated.length > 1) {
9277 const name2 = colonSeparated.pop();
9278 const prefix = colonSeparated.pop();
9279 const result = {
9280 // Allow provider without '@': "provider:prefix:name"
9281 provider: colonSeparated.length > 0 ? colonSeparated[0] : provider,
9282 prefix,
9283 name: name2
9284 };
9285 return validate && !validateIconName(result) ? null : result;
9286 }
9287 const name = colonSeparated[0];
9288 const dashSeparated = name.split("-");
9289 if (dashSeparated.length > 1) {
9290 const result = {
9291 provider,
9292 prefix: dashSeparated.shift(),
9293 name: dashSeparated.join("-")
9294 };
9295 return validate && !validateIconName(result) ? null : result;
9296 }
9297 if (allowSimpleName && provider === "") {
9298 const result = {
9299 provider,
9300 prefix: "",
9301 name
9302 };
9303 return validate && !validateIconName(result, allowSimpleName) ? null : result;
9304 }
9305 return null;
9306 };
9307 const validateIconName = (icon, allowSimpleName) => {
9308 if (!icon) {
9309 return false;
9310 }
9311 return !!// Check prefix: cannot be empty, unless allowSimpleName is enabled
9312 // Check name: cannot be empty
9313 ((allowSimpleName && icon.prefix === "" || !!icon.prefix) && !!icon.name);
9314 };
9315
9316
9317
9318 ;// CONCATENATED MODULE: ../node_modules/@iconify/utils/lib/icon/defaults.mjs
9319 const defaultIconDimensions = Object.freeze(
9320 {
9321 left: 0,
9322 top: 0,
9323 width: 16,
9324 height: 16
9325 }
9326 );
9327 const defaultIconTransformations = Object.freeze({
9328 rotate: 0,
9329 vFlip: false,
9330 hFlip: false
9331 });
9332 const defaultIconProps = Object.freeze({
9333 ...defaultIconDimensions,
9334 ...defaultIconTransformations
9335 });
9336 const defaultExtendedIconProps = Object.freeze({
9337 ...defaultIconProps,
9338 body: "",
9339 hidden: false
9340 });
9341
9342
9343
9344 ;// CONCATENATED MODULE: ../node_modules/@iconify/utils/lib/icon/transformations.mjs
9345 function mergeIconTransformations(obj1, obj2) {
9346 const result = {};
9347 if (!obj1.hFlip !== !obj2.hFlip) {
9348 result.hFlip = true;
9349 }
9350 if (!obj1.vFlip !== !obj2.vFlip) {
9351 result.vFlip = true;
9352 }
9353 const rotate = ((obj1.rotate || 0) + (obj2.rotate || 0)) % 4;
9354 if (rotate) {
9355 result.rotate = rotate;
9356 }
9357 return result;
9358 }
9359
9360
9361
9362 ;// CONCATENATED MODULE: ../node_modules/@iconify/utils/lib/icon/merge.mjs
9363
9364
9365
9366 function mergeIconData(parent, child) {
9367 const result = mergeIconTransformations(parent, child);
9368 for (const key in defaultExtendedIconProps) {
9369 if (key in defaultIconTransformations) {
9370 if (key in parent && !(key in result)) {
9371 result[key] = defaultIconTransformations[key];
9372 }
9373 } else if (key in child) {
9374 result[key] = child[key];
9375 } else if (key in parent) {
9376 result[key] = parent[key];
9377 }
9378 }
9379 return result;
9380 }
9381
9382
9383
9384 ;// CONCATENATED MODULE: ../node_modules/@iconify/utils/lib/icon-set/tree.mjs
9385 function getIconsTree(data, names) {
9386 const icons = data.icons;
9387 const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
9388 const resolved = /* @__PURE__ */ Object.create(null);
9389 function resolve(name) {
9390 if (icons[name]) {
9391 return resolved[name] = [];
9392 }
9393 if (!(name in resolved)) {
9394 resolved[name] = null;
9395 const parent = aliases[name] && aliases[name].parent;
9396 const value = parent && resolve(parent);
9397 if (value) {
9398 resolved[name] = [parent].concat(value);
9399 }
9400 }
9401 return resolved[name];
9402 }
9403 (names || Object.keys(icons).concat(Object.keys(aliases))).forEach(resolve);
9404 return resolved;
9405 }
9406
9407
9408
9409 ;// CONCATENATED MODULE: ../node_modules/@iconify/utils/lib/icon-set/get-icon.mjs
9410
9411
9412
9413
9414
9415 function internalGetIconData(data, name, tree) {
9416 const icons = data.icons;
9417 const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
9418 let currentProps = {};
9419 function parse(name2) {
9420 currentProps = mergeIconData(
9421 icons[name2] || aliases[name2],
9422 currentProps
9423 );
9424 }
9425 parse(name);
9426 tree.forEach(parse);
9427 return mergeIconData(data, currentProps);
9428 }
9429 function getIconData(data, name) {
9430 if (data.icons[name]) {
9431 return internalGetIconData(data, name, []);
9432 }
9433 const tree = getIconsTree(data, [name])[name];
9434 return tree ? internalGetIconData(data, name, tree) : null;
9435 }
9436
9437
9438
9439 ;// CONCATENATED MODULE: ../node_modules/@iconify/utils/lib/customisations/defaults.mjs
9440
9441
9442 const defaultIconSizeCustomisations = Object.freeze({
9443 width: null,
9444 height: null
9445 });
9446 const defaultIconCustomisations = Object.freeze({
9447 // Dimensions
9448 ...defaultIconSizeCustomisations,
9449 // Transformations
9450 ...defaultIconTransformations
9451 });
9452
9453
9454
9455 ;// CONCATENATED MODULE: ../node_modules/@iconify/utils/lib/svg/size.mjs
9456 const unitsSplit = /(-?[0-9.]*[0-9]+[0-9.]*)/g;
9457 const unitsTest = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
9458 function calculateSize(size, ratio, precision) {
9459 if (ratio === 1) {
9460 return size;
9461 }
9462 precision = precision || 100;
9463 if (typeof size === "number") {
9464 return Math.ceil(size * ratio * precision) / precision;
9465 }
9466 if (typeof size !== "string") {
9467 return size;
9468 }
9469 const oldParts = size.split(unitsSplit);
9470 if (oldParts === null || !oldParts.length) {
9471 return size;
9472 }
9473 const newParts = [];
9474 let code = oldParts.shift();
9475 let isNumber = unitsTest.test(code);
9476 while (true) {
9477 if (isNumber) {
9478 const num = parseFloat(code);
9479 if (isNaN(num)) {
9480 newParts.push(code);
9481 } else {
9482 newParts.push(Math.ceil(num * ratio * precision) / precision);
9483 }
9484 } else {
9485 newParts.push(code);
9486 }
9487 code = oldParts.shift();
9488 if (code === void 0) {
9489 return newParts.join("");
9490 }
9491 isNumber = !isNumber;
9492 }
9493 }
9494
9495
9496
9497 ;// CONCATENATED MODULE: ../node_modules/@iconify/utils/lib/svg/defs.mjs
9498 function splitSVGDefs(content, tag = "defs") {
9499 let defs = "";
9500 const index = content.indexOf("<" + tag);
9501 while (index >= 0) {
9502 const start = content.indexOf(">", index);
9503 const end = content.indexOf("</" + tag);
9504 if (start === -1 || end === -1) {
9505 break;
9506 }
9507 const endEnd = content.indexOf(">", end);
9508 if (endEnd === -1) {
9509 break;
9510 }
9511 defs += content.slice(start + 1, end).trim();
9512 content = content.slice(0, index).trim() + content.slice(endEnd + 1);
9513 }
9514 return {
9515 defs,
9516 content
9517 };
9518 }
9519 function mergeDefsAndContent(defs, content) {
9520 return defs ? "<defs>" + defs + "</defs>" + content : content;
9521 }
9522 function wrapSVGContent(body, start, end) {
9523 const split = splitSVGDefs(body);
9524 return mergeDefsAndContent(split.defs, start + split.content + end);
9525 }
9526
9527
9528
9529 ;// CONCATENATED MODULE: ../node_modules/@iconify/utils/lib/svg/build.mjs
9530
9531
9532
9533
9534
9535 const isUnsetKeyword = (value) => value === "unset" || value === "undefined" || value === "none";
9536 function iconToSVG(icon, customisations) {
9537 const fullIcon = {
9538 ...defaultIconProps,
9539 ...icon
9540 };
9541 const fullCustomisations = {
9542 ...defaultIconCustomisations,
9543 ...customisations
9544 };
9545 const box = {
9546 left: fullIcon.left,
9547 top: fullIcon.top,
9548 width: fullIcon.width,
9549 height: fullIcon.height
9550 };
9551 let body = fullIcon.body;
9552 [fullIcon, fullCustomisations].forEach((props) => {
9553 const transformations = [];
9554 const hFlip = props.hFlip;
9555 const vFlip = props.vFlip;
9556 let rotation = props.rotate;
9557 if (hFlip) {
9558 if (vFlip) {
9559 rotation += 2;
9560 } else {
9561 transformations.push(
9562 "translate(" + (box.width + box.left).toString() + " " + (0 - box.top).toString() + ")"
9563 );
9564 transformations.push("scale(-1 1)");
9565 box.top = box.left = 0;
9566 }
9567 } else if (vFlip) {
9568 transformations.push(
9569 "translate(" + (0 - box.left).toString() + " " + (box.height + box.top).toString() + ")"
9570 );
9571 transformations.push("scale(1 -1)");
9572 box.top = box.left = 0;
9573 }
9574 let tempValue;
9575 if (rotation < 0) {
9576 rotation -= Math.floor(rotation / 4) * 4;
9577 }
9578 rotation = rotation % 4;
9579 switch (rotation) {
9580 case 1:
9581 tempValue = box.height / 2 + box.top;
9582 transformations.unshift(
9583 "rotate(90 " + tempValue.toString() + " " + tempValue.toString() + ")"
9584 );
9585 break;
9586 case 2:
9587 transformations.unshift(
9588 "rotate(180 " + (box.width / 2 + box.left).toString() + " " + (box.height / 2 + box.top).toString() + ")"
9589 );
9590 break;
9591 case 3:
9592 tempValue = box.width / 2 + box.left;
9593 transformations.unshift(
9594 "rotate(-90 " + tempValue.toString() + " " + tempValue.toString() + ")"
9595 );
9596 break;
9597 }
9598 if (rotation % 2 === 1) {
9599 if (box.left !== box.top) {
9600 tempValue = box.left;
9601 box.left = box.top;
9602 box.top = tempValue;
9603 }
9604 if (box.width !== box.height) {
9605 tempValue = box.width;
9606 box.width = box.height;
9607 box.height = tempValue;
9608 }
9609 }
9610 if (transformations.length) {
9611 body = wrapSVGContent(
9612 body,
9613 '<g transform="' + transformations.join(" ") + '">',
9614 "</g>"
9615 );
9616 }
9617 });
9618 const customisationsWidth = fullCustomisations.width;
9619 const customisationsHeight = fullCustomisations.height;
9620 const boxWidth = box.width;
9621 const boxHeight = box.height;
9622 let width;
9623 let height;
9624 if (customisationsWidth === null) {
9625 height = customisationsHeight === null ? "1em" : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
9626 width = calculateSize(height, boxWidth / boxHeight);
9627 } else {
9628 width = customisationsWidth === "auto" ? boxWidth : customisationsWidth;
9629 height = customisationsHeight === null ? calculateSize(width, boxHeight / boxWidth) : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
9630 }
9631 const attributes = {};
9632 const setAttr = (prop, value) => {
9633 if (!isUnsetKeyword(value)) {
9634 attributes[prop] = value.toString();
9635 }
9636 };
9637 setAttr("width", width);
9638 setAttr("height", height);
9639 const viewBox = [box.left, box.top, boxWidth, boxHeight];
9640 attributes.viewBox = viewBox.join(" ");
9641 return {
9642 attributes,
9643 viewBox,
9644 body
9645 };
9646 }
9647
9648
9649
9650 ;// CONCATENATED MODULE: ../node_modules/@iconify/utils/lib/svg/html.mjs
9651 function iconToHTML(body, attributes) {
9652 let renderAttribsHTML = body.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
9653 for (const attr in attributes) {
9654 renderAttribsHTML += " " + attr + '="' + attributes[attr] + '"';
9655 }
9656 return '<svg xmlns="http://www.w3.org/2000/svg"' + renderAttribsHTML + ">" + body + "</svg>";
9657 }
9658
9659
9660
9661 ;// CONCATENATED MODULE: ../node_modules/@iconify/utils/lib/svg/id.mjs
9662 const regex = /\sid="(\S+)"/g;
9663 const randomPrefix = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
9664 let counter = 0;
9665 function replaceIDs(body, prefix = randomPrefix) {
9666 const ids = [];
9667 let match;
9668 while (match = regex.exec(body)) {
9669 ids.push(match[1]);
9670 }
9671 if (!ids.length) {
9672 return body;
9673 }
9674 const suffix = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
9675 ids.forEach((id) => {
9676 const newID = typeof prefix === "function" ? prefix(id) : prefix + (counter++).toString();
9677 const escapedID = id.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
9678 body = body.replace(
9679 // Allowed characters before id: [#;"]
9680 // Allowed characters after id: [)"], .[a-z]
9681 new RegExp('([#;"])(' + escapedID + ')([")]|\\.[a-z])', "g"),
9682 "$1" + newID + suffix + "$3"
9683 );
9684 });
9685 body = body.replace(new RegExp(suffix, "g"), "");
9686 return body;
9687 }
9688
9689
9690
9691 ;// CONCATENATED MODULE: ../node_modules/mermaid/dist/chunks/mermaid.core/chunk-H2D2JQ3I.mjs
9692
9693
9694 // src/rendering-util/icons.ts
9695
9696 var unknownIcon = {
9697 body: '<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/><text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;"><tspan x="0" y="0">?</tspan></text></g>',
9698 height: 80,
9699 width: 80
9700 };
9701 var iconsStore = /* @__PURE__ */ new Map();
9702 var loaderStore = /* @__PURE__ */ new Map();
9703 var registerIconPacks = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((iconLoaders) => {
9704 for (const iconLoader of iconLoaders) {
9705 if (!iconLoader.name) {
9706 throw new Error(
9707 'Invalid icon loader. Must have a "name" property with non-empty string value.'
9708 );
9709 }
9710 chunk_YTJNT7DU/* log */.cM.debug("Registering icon pack:", iconLoader.name);
9711 if ("loader" in iconLoader) {
9712 loaderStore.set(iconLoader.name, iconLoader.loader);
9713 } else if ("icons" in iconLoader) {
9714 iconsStore.set(iconLoader.name, iconLoader.icons);
9715 } else {
9716 chunk_YTJNT7DU/* log */.cM.error("Invalid icon loader:", iconLoader);
9717 throw new Error('Invalid icon loader. Must have either "icons" or "loader" property.');
9718 }
9719 }
9720 }, "registerIconPacks");
9721 var getRegisteredIconData = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(async (iconName, fallbackPrefix) => {
9722 const data = stringToIcon(iconName, true, fallbackPrefix !== void 0);
9723 if (!data) {
9724 throw new Error(`Invalid icon name: ${iconName}`);
9725 }
9726 const prefix = data.prefix || fallbackPrefix;
9727 if (!prefix) {
9728 throw new Error(`Icon name must contain a prefix: ${iconName}`);
9729 }
9730 let icons = iconsStore.get(prefix);
9731 if (!icons) {
9732 const loader = loaderStore.get(prefix);
9733 if (!loader) {
9734 throw new Error(`Icon set not found: ${data.prefix}`);
9735 }
9736 try {
9737 const loaded = await loader();
9738 icons = { ...loaded, prefix };
9739 iconsStore.set(prefix, icons);
9740 } catch (e) {
9741 chunk_YTJNT7DU/* log */.cM.error(e);
9742 throw new Error(`Failed to load icon set: ${data.prefix}`);
9743 }
9744 }
9745 const iconData = getIconData(icons, data.name);
9746 if (!iconData) {
9747 throw new Error(`Icon not found: ${iconName}`);
9748 }
9749 return iconData;
9750 }, "getRegisteredIconData");
9751 var getIconSVG = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(async (iconName, customisations) => {
9752 let iconData;
9753 try {
9754 iconData = await getRegisteredIconData(iconName, customisations?.fallbackPrefix);
9755 } catch (e) {
9756 chunk_YTJNT7DU/* log */.cM.error(e);
9757 iconData = unknownIcon;
9758 }
9759 const renderData = iconToSVG(iconData, customisations);
9760 const svg = iconToHTML(replaceIDs(renderData.body), renderData.attributes);
9761 return svg;
9762 }, "getIconSVG");
9763
9764
9765
9766
9767 /***/ }),
9768
9769 /***/ 41921:
9770 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
9771
9772 "use strict";
9773 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9774 /* harmony export */ C1: () => (/* binding */ labelHelper),
9775 /* harmony export */ Fh: () => (/* binding */ isLabelStyle),
9776 /* harmony export */ Lf: () => (/* binding */ insertNode),
9777 /* harmony export */ XO: () => (/* binding */ createLabel_default),
9778 /* harmony export */ Yn: () => (/* binding */ setNodeElem),
9779 /* harmony export */ ZH: () => (/* binding */ clear),
9780 /* harmony export */ aH: () => (/* binding */ positionNode),
9781 /* harmony export */ dW: () => (/* binding */ isValidShape),
9782 /* harmony export */ gU: () => (/* binding */ clear2),
9783 /* harmony export */ jr: () => (/* binding */ updateNodeBounds),
9784 /* harmony export */ us: () => (/* binding */ insertCluster)
9785 /* harmony export */ });
9786 /* harmony import */ var _chunk_K557N5IZ_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81861);
9787 /* harmony import */ var _chunk_H2D2JQ3I_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(62072);
9788 /* harmony import */ var _chunk_C3MQ5ANM_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(39769);
9789 /* harmony import */ var _chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(42626);
9790 /* harmony import */ var _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(86906);
9791 /* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(83619);
9792 /* harmony import */ var roughjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(36366);
9793
9794
9795
9796
9797
9798
9799 // src/rendering-util/rendering-elements/shapes/util.ts
9800
9801 var labelHelper = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(async (parent, node, _classes) => {
9802 let cssClasses;
9803 const useHtmlLabels = node.useHtmlLabels || (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .evaluate */ .ku)((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .nV)()?.htmlLabels);
9804 if (!_classes) {
9805 cssClasses = "node default";
9806 } else {
9807 cssClasses = _classes;
9808 }
9809 const shapeSvg = parent.insert("g").attr("class", cssClasses).attr("id", node.domId || node.id);
9810 const labelEl = shapeSvg.insert("g").attr("class", "label").attr("style", (0,_chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .handleUndefinedAttr */ .R7)(node.labelStyle));
9811 let label;
9812 if (node.label === void 0) {
9813 label = "";
9814 } else {
9815 label = typeof node.label === "string" ? node.label : node.label[0];
9816 }
9817 const text2 = await (0,_chunk_C3MQ5ANM_mjs__WEBPACK_IMPORTED_MODULE_2__/* .createText */ .rw)(labelEl, (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .sanitizeText */ .oO)((0,_chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .decodeEntities */ .SH)(label), (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .nV)()), {
9818 useHtmlLabels,
9819 width: node.width || (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .nV)().flowchart?.wrappingWidth,
9820 // @ts-expect-error -- This is currently not used. Should this be `classes` instead?
9821 cssClasses: "markdown-node-label",
9822 style: node.labelStyle,
9823 addSvgBackground: !!node.icon || !!node.img
9824 });
9825 let bbox = text2.getBBox();
9826 const halfPadding = (node?.padding ?? 0) / 2;
9827 if (useHtmlLabels) {
9828 const div = text2.children[0];
9829 const dv = (0,d3__WEBPACK_IMPORTED_MODULE_5__/* .select */ .Ys)(text2);
9830 const images = div.getElementsByTagName("img");
9831 if (images) {
9832 const noImgText = label.replace(/<img[^>]*>/g, "").trim() === "";
9833 await Promise.all(
9834 [...images].map(
9835 (img) => new Promise((res) => {
9836 function setupImage() {
9837 img.style.display = "flex";
9838 img.style.flexDirection = "column";
9839 if (noImgText) {
9840 const bodyFontSize = (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .nV)().fontSize ? (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .nV)().fontSize : window.getComputedStyle(document.body).fontSize;
9841 const enlargingFactor = 5;
9842 const [parsedBodyFontSize = _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .defaultConfig_default */ .vZ.fontSize] = (0,_chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .parseFontSize */ .VG)(bodyFontSize);
9843 const width = parsedBodyFontSize * enlargingFactor + "px";
9844 img.style.minWidth = width;
9845 img.style.maxWidth = width;
9846 } else {
9847 img.style.width = "100%";
9848 }
9849 res(img);
9850 }
9851 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(setupImage, "setupImage");
9852 setTimeout(() => {
9853 if (img.complete) {
9854 setupImage();
9855 }
9856 });
9857 img.addEventListener("error", setupImage);
9858 img.addEventListener("load", setupImage);
9859 })
9860 )
9861 );
9862 }
9863 bbox = div.getBoundingClientRect();
9864 dv.attr("width", bbox.width);
9865 dv.attr("height", bbox.height);
9866 }
9867 if (useHtmlLabels) {
9868 labelEl.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")");
9869 } else {
9870 labelEl.attr("transform", "translate(0, " + -bbox.height / 2 + ")");
9871 }
9872 if (node.centerLabel) {
9873 labelEl.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")");
9874 }
9875 labelEl.insert("rect", ":first-child");
9876 return { shapeSvg, bbox, halfPadding, label: labelEl };
9877 }, "labelHelper");
9878 var insertLabel = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(async (parent, label, options) => {
9879 const useHtmlLabels = options.useHtmlLabels || (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .evaluate */ .ku)((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .nV)()?.flowchart?.htmlLabels);
9880 const labelEl = parent.insert("g").attr("class", "label").attr("style", options.labelStyle || "");
9881 const text2 = await (0,_chunk_C3MQ5ANM_mjs__WEBPACK_IMPORTED_MODULE_2__/* .createText */ .rw)(labelEl, (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .sanitizeText */ .oO)((0,_chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .decodeEntities */ .SH)(label), (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .nV)()), {
9882 useHtmlLabels,
9883 width: options.width || (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .nV)()?.flowchart?.wrappingWidth,
9884 style: options.labelStyle,
9885 addSvgBackground: !!options.icon || !!options.img
9886 });
9887 let bbox = text2.getBBox();
9888 const halfPadding = options.padding / 2;
9889 if ((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .evaluate */ .ku)((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .nV)()?.flowchart?.htmlLabels)) {
9890 const div = text2.children[0];
9891 const dv = (0,d3__WEBPACK_IMPORTED_MODULE_5__/* .select */ .Ys)(text2);
9892 bbox = div.getBoundingClientRect();
9893 dv.attr("width", bbox.width);
9894 dv.attr("height", bbox.height);
9895 }
9896 if (useHtmlLabels) {
9897 labelEl.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")");
9898 } else {
9899 labelEl.attr("transform", "translate(0, " + -bbox.height / 2 + ")");
9900 }
9901 if (options.centerLabel) {
9902 labelEl.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")");
9903 }
9904 labelEl.insert("rect", ":first-child");
9905 return { shapeSvg: parent, bbox, halfPadding, label: labelEl };
9906 }, "insertLabel");
9907 var updateNodeBounds = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)((node, element) => {
9908 const bbox = element.node().getBBox();
9909 node.width = bbox.width;
9910 node.height = bbox.height;
9911 }, "updateNodeBounds");
9912 var getNodeClasses = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)((node, extra) => (node.look === "handDrawn" ? "rough-node" : "node") + " " + node.cssClasses + " " + (extra || ""), "getNodeClasses");
9913 function createPathFromPoints(points) {
9914 const pointStrings = points.map((p, i) => `${i === 0 ? "M" : "L"}${p.x},${p.y}`);
9915 pointStrings.push("Z");
9916 return pointStrings.join(" ");
9917 }
9918 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(createPathFromPoints, "createPathFromPoints");
9919 function generateFullSineWavePoints(x1, y1, x2, y2, amplitude, numCycles) {
9920 const points = [];
9921 const steps = 50;
9922 const deltaX = x2 - x1;
9923 const deltaY = y2 - y1;
9924 const cycleLength = deltaX / numCycles;
9925 const frequency = 2 * Math.PI / cycleLength;
9926 const midY = y1 + deltaY / 2;
9927 for (let i = 0; i <= steps; i++) {
9928 const t = i / steps;
9929 const x = x1 + t * deltaX;
9930 const y = midY + amplitude * Math.sin(frequency * (x - x1));
9931 points.push({ x, y });
9932 }
9933 return points;
9934 }
9935 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(generateFullSineWavePoints, "generateFullSineWavePoints");
9936 function generateCirclePoints(centerX, centerY, radius, numPoints, startAngle, endAngle) {
9937 const points = [];
9938 const startAngleRad = startAngle * Math.PI / 180;
9939 const endAngleRad = endAngle * Math.PI / 180;
9940 const angleRange = endAngleRad - startAngleRad;
9941 const angleStep = angleRange / (numPoints - 1);
9942 for (let i = 0; i < numPoints; i++) {
9943 const angle = startAngleRad + i * angleStep;
9944 const x = centerX + radius * Math.cos(angle);
9945 const y = centerY + radius * Math.sin(angle);
9946 points.push({ x: -x, y: -y });
9947 }
9948 return points;
9949 }
9950 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(generateCirclePoints, "generateCirclePoints");
9951
9952 // src/rendering-util/rendering-elements/clusters.js
9953
9954
9955
9956 // src/rendering-util/rendering-elements/intersect/intersect-rect.js
9957 var intersectRect = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)((node, point) => {
9958 var x = node.x;
9959 var y = node.y;
9960 var dx = point.x - x;
9961 var dy = point.y - y;
9962 var w = node.width / 2;
9963 var h = node.height / 2;
9964 var sx, sy;
9965 if (Math.abs(dy) * w > Math.abs(dx) * h) {
9966 if (dy < 0) {
9967 h = -h;
9968 }
9969 sx = dy === 0 ? 0 : h * dx / dy;
9970 sy = h;
9971 } else {
9972 if (dx < 0) {
9973 w = -w;
9974 }
9975 sx = w;
9976 sy = dx === 0 ? 0 : w * dy / dx;
9977 }
9978 return { x: x + sx, y: y + sy };
9979 }, "intersectRect");
9980 var intersect_rect_default = intersectRect;
9981
9982 // src/rendering-util/rendering-elements/createLabel.js
9983
9984 function applyStyle(dom, styleFn) {
9985 if (styleFn) {
9986 dom.attr("style", styleFn);
9987 }
9988 }
9989 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(applyStyle, "applyStyle");
9990 async function addHtmlLabel(node) {
9991 const fo = (0,d3__WEBPACK_IMPORTED_MODULE_5__/* .select */ .Ys)(document.createElementNS("http://www.w3.org/2000/svg", "foreignObject"));
9992 const div = fo.append("xhtml:div");
9993 let label = node.label;
9994 if (node.label && (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .hasKatex */ .l0)(node.label)) {
9995 label = await (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .renderKatex */ .uT)(node.label.replace(_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .common_default */ .SY.lineBreakRegex, "\n"), (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .nV)());
9996 }
9997 const labelClass = node.isNode ? "nodeLabel" : "edgeLabel";
9998 div.html(
9999 '<span class="' + labelClass + '" ' + (node.labelStyle ? 'style="' + node.labelStyle + '"' : "") + // codeql [js/html-constructed-from-input] : false positive
10000 ">" + label + "</span>"
10001 );
10002 applyStyle(div, node.labelStyle);
10003 div.style("display", "inline-block");
10004 div.style("padding-right", "1px");
10005 div.style("white-space", "nowrap");
10006 div.attr("xmlns", "http://www.w3.org/1999/xhtml");
10007 return fo.node();
10008 }
10009 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(addHtmlLabel, "addHtmlLabel");
10010 var createLabel = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(async (_vertexText, style, isTitle, isNode) => {
10011 let vertexText = _vertexText || "";
10012 if (typeof vertexText === "object") {
10013 vertexText = vertexText[0];
10014 }
10015 if ((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .evaluate */ .ku)((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .nV)().flowchart.htmlLabels)) {
10016 vertexText = vertexText.replace(/\\n|\n/g, "<br />");
10017 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .cM.info("vertexText" + vertexText);
10018 const node = {
10019 isNode,
10020 label: (0,_chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .decodeEntities */ .SH)(vertexText).replace(
10021 /fa[blrs]?:fa-[\w-]+/g,
10022 (s) => `<i class='${s.replace(":", " ")}'></i>`
10023 ),
10024 labelStyle: style ? style.replace("fill:", "color:") : style
10025 };
10026 let vertexNode = await addHtmlLabel(node);
10027 return vertexNode;
10028 } else {
10029 const svgLabel = document.createElementNS("http://www.w3.org/2000/svg", "text");
10030 svgLabel.setAttribute("style", style.replace("color:", "fill:"));
10031 let rows = [];
10032 if (typeof vertexText === "string") {
10033 rows = vertexText.split(/\\n|\n|<br\s*\/?>/gi);
10034 } else if (Array.isArray(vertexText)) {
10035 rows = vertexText;
10036 } else {
10037 rows = [];
10038 }
10039 for (const row of rows) {
10040 const tspan = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
10041 tspan.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve");
10042 tspan.setAttribute("dy", "1em");
10043 tspan.setAttribute("x", "0");
10044 if (isTitle) {
10045 tspan.setAttribute("class", "title-row");
10046 } else {
10047 tspan.setAttribute("class", "row");
10048 }
10049 tspan.textContent = row.trim();
10050 svgLabel.appendChild(tspan);
10051 }
10052 return svgLabel;
10053 }
10054 }, "createLabel");
10055 var createLabel_default = createLabel;
10056
10057 // src/rendering-util/rendering-elements/shapes/roundedRectPath.ts
10058 var createRoundedRectPathD = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)((x, y, totalWidth, totalHeight, radius) => [
10059 "M",
10060 x + radius,
10061 y,
10062 // Move to the first point
10063 "H",
10064 x + totalWidth - radius,
10065 // Draw horizontal line to the beginning of the right corner
10066 "A",
10067 radius,
10068 radius,
10069 0,
10070 0,
10071 1,
10072 x + totalWidth,
10073 y + radius,
10074 // Draw arc to the right top corner
10075 "V",
10076 y + totalHeight - radius,
10077 // Draw vertical line down to the beginning of the right bottom corner
10078 "A",
10079 radius,
10080 radius,
10081 0,
10082 0,
10083 1,
10084 x + totalWidth - radius,
10085 y + totalHeight,
10086 // Draw arc to the right bottom corner
10087 "H",
10088 x + radius,
10089 // Draw horizontal line to the beginning of the left bottom corner
10090 "A",
10091 radius,
10092 radius,
10093 0,
10094 0,
10095 1,
10096 x,
10097 y + totalHeight - radius,
10098 // Draw arc to the left bottom corner
10099 "V",
10100 y + radius,
10101 // Draw vertical line up to the beginning of the left top corner
10102 "A",
10103 radius,
10104 radius,
10105 0,
10106 0,
10107 1,
10108 x + radius,
10109 y,
10110 // Draw arc to the left top corner
10111 "Z"
10112 // Close the path
10113 ].join(" "), "createRoundedRectPathD");
10114
10115 // src/rendering-util/rendering-elements/shapes/handDrawnShapeStyles.ts
10116 var solidStateFill = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)((color) => {
10117 const { handDrawnSeed } = (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .nV)();
10118 return {
10119 fill: color,
10120 hachureAngle: 120,
10121 // angle of hachure,
10122 hachureGap: 4,
10123 fillWeight: 2,
10124 roughness: 0.7,
10125 stroke: color,
10126 seed: handDrawnSeed
10127 };
10128 }, "solidStateFill");
10129 var compileStyles = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)((node) => {
10130 const stylesMap = styles2Map([...node.cssCompiledStyles || [], ...node.cssStyles || []]);
10131 return { stylesMap, stylesArray: [...stylesMap] };
10132 }, "compileStyles");
10133 var styles2Map = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)((styles) => {
10134 const styleMap = /* @__PURE__ */ new Map();
10135 styles.forEach((style) => {
10136 const [key, value] = style.split(":");
10137 styleMap.set(key.trim(), value?.trim());
10138 });
10139 return styleMap;
10140 }, "styles2Map");
10141 var isLabelStyle = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)((key) => {
10142 return key === "color" || key === "font-size" || key === "font-family" || key === "font-weight" || key === "font-style" || key === "text-decoration" || key === "text-align" || key === "text-transform" || key === "line-height" || key === "letter-spacing" || key === "word-spacing" || key === "text-shadow" || key === "text-overflow" || key === "white-space" || key === "word-wrap" || key === "word-break" || key === "overflow-wrap" || key === "hyphens";
10143 }, "isLabelStyle");
10144 var styles2String = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)((node) => {
10145 const { stylesArray } = compileStyles(node);
10146 const labelStyles = [];
10147 const nodeStyles = [];
10148 const borderStyles = [];
10149 const backgroundStyles = [];
10150 stylesArray.forEach((style) => {
10151 const key = style[0];
10152 if (isLabelStyle(key)) {
10153 labelStyles.push(style.join(":") + " !important");
10154 } else {
10155 nodeStyles.push(style.join(":") + " !important");
10156 if (key.includes("stroke")) {
10157 borderStyles.push(style.join(":") + " !important");
10158 }
10159 if (key === "fill") {
10160 backgroundStyles.push(style.join(":") + " !important");
10161 }
10162 }
10163 });
10164 return {
10165 labelStyles: labelStyles.join(";"),
10166 nodeStyles: nodeStyles.join(";"),
10167 stylesArray,
10168 borderStyles,
10169 backgroundStyles
10170 };
10171 }, "styles2String");
10172 var userNodeOverrides = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)((node, options) => {
10173 const { themeVariables, handDrawnSeed } = (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .nV)();
10174 const { nodeBorder, mainBkg } = themeVariables;
10175 const { stylesMap } = compileStyles(node);
10176 const result = Object.assign(
10177 {
10178 roughness: 0.7,
10179 fill: stylesMap.get("fill") || mainBkg,
10180 fillStyle: "hachure",
10181 // solid fill
10182 fillWeight: 4,
10183 hachureGap: 5.2,
10184 stroke: stylesMap.get("stroke") || nodeBorder,
10185 seed: handDrawnSeed,
10186 strokeWidth: stylesMap.get("stroke-width")?.replace("px", "") || 1.3,
10187 fillLineDash: [0, 0]
10188 },
10189 options
10190 );
10191 return result;
10192 }, "userNodeOverrides");
10193
10194 // src/rendering-util/rendering-elements/clusters.js
10195 var rect = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(async (parent, node) => {
10196 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .cM.info("Creating subgraph rect for ", node.id, node);
10197 const siteConfig = (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .nV)();
10198 const { themeVariables, handDrawnSeed } = siteConfig;
10199 const { clusterBkg, clusterBorder } = themeVariables;
10200 const { labelStyles, nodeStyles, borderStyles, backgroundStyles } = styles2String(node);
10201 const shapeSvg = parent.insert("g").attr("class", "cluster " + node.cssClasses).attr("id", node.id).attr("data-look", node.look);
10202 const useHtmlLabels = (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .evaluate */ .ku)(siteConfig.flowchart.htmlLabels);
10203 const labelEl = shapeSvg.insert("g").attr("class", "cluster-label ");
10204 const text2 = await (0,_chunk_C3MQ5ANM_mjs__WEBPACK_IMPORTED_MODULE_2__/* .createText */ .rw)(labelEl, node.label, {
10205 style: node.labelStyle,
10206 useHtmlLabels,
10207 isNode: true
10208 });
10209 let bbox = text2.getBBox();
10210 if ((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .evaluate */ .ku)(siteConfig.flowchart.htmlLabels)) {
10211 const div = text2.children[0];
10212 const dv = (0,d3__WEBPACK_IMPORTED_MODULE_5__/* .select */ .Ys)(text2);
10213 bbox = div.getBoundingClientRect();
10214 dv.attr("width", bbox.width);
10215 dv.attr("height", bbox.height);
10216 }
10217 const width = node.width <= bbox.width + node.padding ? bbox.width + node.padding : node.width;
10218 if (node.width <= bbox.width + node.padding) {
10219 node.diff = (width - node.width) / 2 - node.padding;
10220 } else {
10221 node.diff = -node.padding;
10222 }
10223 const height = node.height;
10224 const x = node.x - width / 2;
10225 const y = node.y - height / 2;
10226 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .cM.trace("Data ", node, JSON.stringify(node));
10227 let rect2;
10228 if (node.look === "handDrawn") {
10229 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
10230 const options = userNodeOverrides(node, {
10231 roughness: 0.7,
10232 fill: clusterBkg,
10233 // fill: 'red',
10234 stroke: clusterBorder,
10235 fillWeight: 3,
10236 seed: handDrawnSeed
10237 });
10238 const roughNode = rc.path(createRoundedRectPathD(x, y, width, height, 0), options);
10239 rect2 = shapeSvg.insert(() => {
10240 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .cM.debug("Rough node insert CXC", roughNode);
10241 return roughNode;
10242 }, ":first-child");
10243 rect2.select("path:nth-child(2)").attr("style", borderStyles.join(";"));
10244 rect2.select("path").attr("style", backgroundStyles.join(";").replace("fill", "stroke"));
10245 } else {
10246 rect2 = shapeSvg.insert("rect", ":first-child");
10247 rect2.attr("style", nodeStyles).attr("rx", node.rx).attr("ry", node.ry).attr("x", x).attr("y", y).attr("width", width).attr("height", height);
10248 }
10249 const { subGraphTitleTopMargin } = (0,_chunk_K557N5IZ_mjs__WEBPACK_IMPORTED_MODULE_0__/* .getSubGraphTitleMargins */ .L)(siteConfig);
10250 labelEl.attr(
10251 "transform",
10252 // This puts the label on top of the box instead of inside it
10253 `translate(${node.x - bbox.width / 2}, ${node.y - node.height / 2 + subGraphTitleTopMargin})`
10254 );
10255 if (labelStyles) {
10256 const span = labelEl.select("span");
10257 if (span) {
10258 span.attr("style", labelStyles);
10259 }
10260 }
10261 const rectBox = rect2.node().getBBox();
10262 node.offsetX = 0;
10263 node.width = rectBox.width;
10264 node.height = rectBox.height;
10265 node.offsetY = bbox.height - node.padding / 2;
10266 node.intersect = function(point) {
10267 return intersect_rect_default(node, point);
10268 };
10269 return { cluster: shapeSvg, labelBBox: bbox };
10270 }, "rect");
10271 var noteGroup = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)((parent, node) => {
10272 const shapeSvg = parent.insert("g").attr("class", "note-cluster").attr("id", node.id);
10273 const rect2 = shapeSvg.insert("rect", ":first-child");
10274 const padding = 0 * node.padding;
10275 const halfPadding = padding / 2;
10276 rect2.attr("rx", node.rx).attr("ry", node.ry).attr("x", node.x - node.width / 2 - halfPadding).attr("y", node.y - node.height / 2 - halfPadding).attr("width", node.width + padding).attr("height", node.height + padding).attr("fill", "none");
10277 const rectBox = rect2.node().getBBox();
10278 node.width = rectBox.width;
10279 node.height = rectBox.height;
10280 node.intersect = function(point) {
10281 return intersect_rect_default(node, point);
10282 };
10283 return { cluster: shapeSvg, labelBBox: { width: 0, height: 0 } };
10284 }, "noteGroup");
10285 var roundedWithTitle = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(async (parent, node) => {
10286 const siteConfig = (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .nV)();
10287 const { themeVariables, handDrawnSeed } = siteConfig;
10288 const { altBackground, compositeBackground, compositeTitleBackground, nodeBorder } = themeVariables;
10289 const shapeSvg = parent.insert("g").attr("class", node.cssClasses).attr("id", node.id).attr("data-id", node.id).attr("data-look", node.look);
10290 const outerRectG = shapeSvg.insert("g", ":first-child");
10291 const label = shapeSvg.insert("g").attr("class", "cluster-label");
10292 let innerRect = shapeSvg.append("rect");
10293 const text2 = label.node().appendChild(await createLabel_default(node.label, node.labelStyle, void 0, true));
10294 let bbox = text2.getBBox();
10295 if ((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .evaluate */ .ku)(siteConfig.flowchart.htmlLabels)) {
10296 const div = text2.children[0];
10297 const dv = (0,d3__WEBPACK_IMPORTED_MODULE_5__/* .select */ .Ys)(text2);
10298 bbox = div.getBoundingClientRect();
10299 dv.attr("width", bbox.width);
10300 dv.attr("height", bbox.height);
10301 }
10302 const padding = 0 * node.padding;
10303 const halfPadding = padding / 2;
10304 const width = (node.width <= bbox.width + node.padding ? bbox.width + node.padding : node.width) + padding;
10305 if (node.width <= bbox.width + node.padding) {
10306 node.diff = (width - node.width) / 2 - node.padding;
10307 } else {
10308 node.diff = -node.padding;
10309 }
10310 const height = node.height + padding;
10311 const innerHeight = node.height + padding - bbox.height - 6;
10312 const x = node.x - width / 2;
10313 const y = node.y - height / 2;
10314 node.width = width;
10315 const innerY = node.y - node.height / 2 - halfPadding + bbox.height + 2;
10316 let rect2;
10317 if (node.look === "handDrawn") {
10318 const isAlt = node.cssClasses.includes("statediagram-cluster-alt");
10319 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
10320 const roughOuterNode = node.rx || node.ry ? rc.path(createRoundedRectPathD(x, y, width, height, 10), {
10321 roughness: 0.7,
10322 fill: compositeTitleBackground,
10323 fillStyle: "solid",
10324 stroke: nodeBorder,
10325 seed: handDrawnSeed
10326 }) : rc.rectangle(x, y, width, height, { seed: handDrawnSeed });
10327 rect2 = shapeSvg.insert(() => roughOuterNode, ":first-child");
10328 const roughInnerNode = rc.rectangle(x, innerY, width, innerHeight, {
10329 fill: isAlt ? altBackground : compositeBackground,
10330 fillStyle: isAlt ? "hachure" : "solid",
10331 stroke: nodeBorder,
10332 seed: handDrawnSeed
10333 });
10334 rect2 = shapeSvg.insert(() => roughOuterNode, ":first-child");
10335 innerRect = shapeSvg.insert(() => roughInnerNode);
10336 } else {
10337 rect2 = outerRectG.insert("rect", ":first-child");
10338 const outerRectClass = "outer";
10339 rect2.attr("class", outerRectClass).attr("x", x).attr("y", y).attr("width", width).attr("height", height).attr("data-look", node.look);
10340 innerRect.attr("class", "inner").attr("x", x).attr("y", innerY).attr("width", width).attr("height", innerHeight);
10341 }
10342 label.attr(
10343 "transform",
10344 `translate(${node.x - bbox.width / 2}, ${y + 1 - ((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .evaluate */ .ku)(siteConfig.flowchart.htmlLabels) ? 0 : 3)})`
10345 );
10346 const rectBox = rect2.node().getBBox();
10347 node.height = rectBox.height;
10348 node.offsetX = 0;
10349 node.offsetY = bbox.height - node.padding / 2;
10350 node.labelBBox = bbox;
10351 node.intersect = function(point) {
10352 return intersect_rect_default(node, point);
10353 };
10354 return { cluster: shapeSvg, labelBBox: bbox };
10355 }, "roundedWithTitle");
10356 var kanbanSection = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(async (parent, node) => {
10357 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .cM.info("Creating subgraph rect for ", node.id, node);
10358 const siteConfig = (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .nV)();
10359 const { themeVariables, handDrawnSeed } = siteConfig;
10360 const { clusterBkg, clusterBorder } = themeVariables;
10361 const { labelStyles, nodeStyles, borderStyles, backgroundStyles } = styles2String(node);
10362 const shapeSvg = parent.insert("g").attr("class", "cluster " + node.cssClasses).attr("id", node.id).attr("data-look", node.look);
10363 const useHtmlLabels = (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .evaluate */ .ku)(siteConfig.flowchart.htmlLabels);
10364 const labelEl = shapeSvg.insert("g").attr("class", "cluster-label ");
10365 const text2 = await (0,_chunk_C3MQ5ANM_mjs__WEBPACK_IMPORTED_MODULE_2__/* .createText */ .rw)(labelEl, node.label, {
10366 style: node.labelStyle,
10367 useHtmlLabels,
10368 isNode: true,
10369 width: node.width
10370 });
10371 let bbox = text2.getBBox();
10372 if ((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .evaluate */ .ku)(siteConfig.flowchart.htmlLabels)) {
10373 const div = text2.children[0];
10374 const dv = (0,d3__WEBPACK_IMPORTED_MODULE_5__/* .select */ .Ys)(text2);
10375 bbox = div.getBoundingClientRect();
10376 dv.attr("width", bbox.width);
10377 dv.attr("height", bbox.height);
10378 }
10379 const width = node.width <= bbox.width + node.padding ? bbox.width + node.padding : node.width;
10380 if (node.width <= bbox.width + node.padding) {
10381 node.diff = (width - node.width) / 2 - node.padding;
10382 } else {
10383 node.diff = -node.padding;
10384 }
10385 const height = node.height;
10386 const x = node.x - width / 2;
10387 const y = node.y - height / 2;
10388 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .cM.trace("Data ", node, JSON.stringify(node));
10389 let rect2;
10390 if (node.look === "handDrawn") {
10391 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
10392 const options = userNodeOverrides(node, {
10393 roughness: 0.7,
10394 fill: clusterBkg,
10395 // fill: 'red',
10396 stroke: clusterBorder,
10397 fillWeight: 4,
10398 seed: handDrawnSeed
10399 });
10400 const roughNode = rc.path(createRoundedRectPathD(x, y, width, height, node.rx), options);
10401 rect2 = shapeSvg.insert(() => {
10402 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .cM.debug("Rough node insert CXC", roughNode);
10403 return roughNode;
10404 }, ":first-child");
10405 rect2.select("path:nth-child(2)").attr("style", borderStyles.join(";"));
10406 rect2.select("path").attr("style", backgroundStyles.join(";").replace("fill", "stroke"));
10407 } else {
10408 rect2 = shapeSvg.insert("rect", ":first-child");
10409 rect2.attr("style", nodeStyles).attr("rx", node.rx).attr("ry", node.ry).attr("x", x).attr("y", y).attr("width", width).attr("height", height);
10410 }
10411 const { subGraphTitleTopMargin } = (0,_chunk_K557N5IZ_mjs__WEBPACK_IMPORTED_MODULE_0__/* .getSubGraphTitleMargins */ .L)(siteConfig);
10412 labelEl.attr(
10413 "transform",
10414 // This puts the label on top of the box instead of inside it
10415 `translate(${node.x - bbox.width / 2}, ${node.y - node.height / 2 + subGraphTitleTopMargin})`
10416 );
10417 if (labelStyles) {
10418 const span = labelEl.select("span");
10419 if (span) {
10420 span.attr("style", labelStyles);
10421 }
10422 }
10423 const rectBox = rect2.node().getBBox();
10424 node.offsetX = 0;
10425 node.width = rectBox.width;
10426 node.height = rectBox.height;
10427 node.offsetY = bbox.height - node.padding / 2;
10428 node.intersect = function(point) {
10429 return intersect_rect_default(node, point);
10430 };
10431 return { cluster: shapeSvg, labelBBox: bbox };
10432 }, "kanbanSection");
10433 var divider = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)((parent, node) => {
10434 const siteConfig = (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .nV)();
10435 const { themeVariables, handDrawnSeed } = siteConfig;
10436 const { nodeBorder } = themeVariables;
10437 const shapeSvg = parent.insert("g").attr("class", node.cssClasses).attr("id", node.id).attr("data-look", node.look);
10438 const outerRectG = shapeSvg.insert("g", ":first-child");
10439 const padding = 0 * node.padding;
10440 const width = node.width + padding;
10441 node.diff = -node.padding;
10442 const height = node.height + padding;
10443 const x = node.x - width / 2;
10444 const y = node.y - height / 2;
10445 node.width = width;
10446 let rect2;
10447 if (node.look === "handDrawn") {
10448 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
10449 const roughOuterNode = rc.rectangle(x, y, width, height, {
10450 fill: "lightgrey",
10451 roughness: 0.5,
10452 strokeLineDash: [5],
10453 stroke: nodeBorder,
10454 seed: handDrawnSeed
10455 });
10456 rect2 = shapeSvg.insert(() => roughOuterNode, ":first-child");
10457 } else {
10458 rect2 = outerRectG.insert("rect", ":first-child");
10459 const outerRectClass = "divider";
10460 rect2.attr("class", outerRectClass).attr("x", x).attr("y", y).attr("width", width).attr("height", height).attr("data-look", node.look);
10461 }
10462 const rectBox = rect2.node().getBBox();
10463 node.height = rectBox.height;
10464 node.offsetX = 0;
10465 node.offsetY = 0;
10466 node.intersect = function(point) {
10467 return intersect_rect_default(node, point);
10468 };
10469 return { cluster: shapeSvg, labelBBox: {} };
10470 }, "divider");
10471 var squareRect = rect;
10472 var shapes = {
10473 rect,
10474 squareRect,
10475 roundedWithTitle,
10476 noteGroup,
10477 divider,
10478 kanbanSection
10479 };
10480 var clusterElems = /* @__PURE__ */ new Map();
10481 var insertCluster = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(async (elem, node) => {
10482 const shape = node.shape || "rect";
10483 const cluster = await shapes[shape](elem, node);
10484 clusterElems.set(node.id, cluster);
10485 return cluster;
10486 }, "insertCluster");
10487 var clear = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(() => {
10488 clusterElems = /* @__PURE__ */ new Map();
10489 }, "clear");
10490
10491 // src/rendering-util/rendering-elements/intersect/intersect-node.js
10492 function intersectNode(node, point) {
10493 return node.intersect(point);
10494 }
10495 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(intersectNode, "intersectNode");
10496 var intersect_node_default = intersectNode;
10497
10498 // src/rendering-util/rendering-elements/intersect/intersect-ellipse.js
10499 function intersectEllipse(node, rx, ry, point) {
10500 var cx = node.x;
10501 var cy = node.y;
10502 var px = cx - point.x;
10503 var py = cy - point.y;
10504 var det = Math.sqrt(rx * rx * py * py + ry * ry * px * px);
10505 var dx = Math.abs(rx * ry * px / det);
10506 if (point.x < cx) {
10507 dx = -dx;
10508 }
10509 var dy = Math.abs(rx * ry * py / det);
10510 if (point.y < cy) {
10511 dy = -dy;
10512 }
10513 return { x: cx + dx, y: cy + dy };
10514 }
10515 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(intersectEllipse, "intersectEllipse");
10516 var intersect_ellipse_default = intersectEllipse;
10517
10518 // src/rendering-util/rendering-elements/intersect/intersect-circle.js
10519 function intersectCircle(node, rx, point) {
10520 return intersect_ellipse_default(node, rx, rx, point);
10521 }
10522 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(intersectCircle, "intersectCircle");
10523 var intersect_circle_default = intersectCircle;
10524
10525 // src/rendering-util/rendering-elements/intersect/intersect-line.js
10526 function intersectLine(p1, p2, q1, q2) {
10527 var a1, a2, b1, b2, c1, c2;
10528 var r1, r2, r3, r4;
10529 var denom, offset, num;
10530 var x, y;
10531 a1 = p2.y - p1.y;
10532 b1 = p1.x - p2.x;
10533 c1 = p2.x * p1.y - p1.x * p2.y;
10534 r3 = a1 * q1.x + b1 * q1.y + c1;
10535 r4 = a1 * q2.x + b1 * q2.y + c1;
10536 if (r3 !== 0 && r4 !== 0 && sameSign(r3, r4)) {
10537 return;
10538 }
10539 a2 = q2.y - q1.y;
10540 b2 = q1.x - q2.x;
10541 c2 = q2.x * q1.y - q1.x * q2.y;
10542 r1 = a2 * p1.x + b2 * p1.y + c2;
10543 r2 = a2 * p2.x + b2 * p2.y + c2;
10544 if (r1 !== 0 && r2 !== 0 && sameSign(r1, r2)) {
10545 return;
10546 }
10547 denom = a1 * b2 - a2 * b1;
10548 if (denom === 0) {
10549 return;
10550 }
10551 offset = Math.abs(denom / 2);
10552 num = b1 * c2 - b2 * c1;
10553 x = num < 0 ? (num - offset) / denom : (num + offset) / denom;
10554 num = a2 * c1 - a1 * c2;
10555 y = num < 0 ? (num - offset) / denom : (num + offset) / denom;
10556 return { x, y };
10557 }
10558 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(intersectLine, "intersectLine");
10559 function sameSign(r1, r2) {
10560 return r1 * r2 > 0;
10561 }
10562 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(sameSign, "sameSign");
10563 var intersect_line_default = intersectLine;
10564
10565 // src/rendering-util/rendering-elements/intersect/intersect-polygon.js
10566 function intersectPolygon(node, polyPoints, point) {
10567 let x1 = node.x;
10568 let y1 = node.y;
10569 let intersections = [];
10570 let minX = Number.POSITIVE_INFINITY;
10571 let minY = Number.POSITIVE_INFINITY;
10572 if (typeof polyPoints.forEach === "function") {
10573 polyPoints.forEach(function(entry) {
10574 minX = Math.min(minX, entry.x);
10575 minY = Math.min(minY, entry.y);
10576 });
10577 } else {
10578 minX = Math.min(minX, polyPoints.x);
10579 minY = Math.min(minY, polyPoints.y);
10580 }
10581 let left = x1 - node.width / 2 - minX;
10582 let top = y1 - node.height / 2 - minY;
10583 for (let i = 0; i < polyPoints.length; i++) {
10584 let p1 = polyPoints[i];
10585 let p2 = polyPoints[i < polyPoints.length - 1 ? i + 1 : 0];
10586 let intersect = intersect_line_default(
10587 node,
10588 point,
10589 { x: left + p1.x, y: top + p1.y },
10590 { x: left + p2.x, y: top + p2.y }
10591 );
10592 if (intersect) {
10593 intersections.push(intersect);
10594 }
10595 }
10596 if (!intersections.length) {
10597 return node;
10598 }
10599 if (intersections.length > 1) {
10600 intersections.sort(function(p, q) {
10601 let pdx = p.x - point.x;
10602 let pdy = p.y - point.y;
10603 let distp = Math.sqrt(pdx * pdx + pdy * pdy);
10604 let qdx = q.x - point.x;
10605 let qdy = q.y - point.y;
10606 let distq = Math.sqrt(qdx * qdx + qdy * qdy);
10607 return distp < distq ? -1 : distp === distq ? 0 : 1;
10608 });
10609 }
10610 return intersections[0];
10611 }
10612 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(intersectPolygon, "intersectPolygon");
10613 var intersect_polygon_default = intersectPolygon;
10614
10615 // src/rendering-util/rendering-elements/intersect/index.js
10616 var intersect_default = {
10617 node: intersect_node_default,
10618 circle: intersect_circle_default,
10619 ellipse: intersect_ellipse_default,
10620 polygon: intersect_polygon_default,
10621 rect: intersect_rect_default
10622 };
10623
10624 // src/rendering-util/rendering-elements/shapes/anchor.ts
10625
10626 function anchor(parent, node) {
10627 const { labelStyles } = styles2String(node);
10628 node.labelStyle = labelStyles;
10629 const classes = getNodeClasses(node);
10630 let cssClasses = classes;
10631 if (!classes) {
10632 cssClasses = "anchor";
10633 }
10634 const shapeSvg = parent.insert("g").attr("class", cssClasses).attr("id", node.domId || node.id);
10635 const radius = 1;
10636 const { cssStyles } = node;
10637 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
10638 const options = userNodeOverrides(node, { fill: "black", stroke: "none", fillStyle: "solid" });
10639 if (node.look !== "handDrawn") {
10640 options.roughness = 0;
10641 }
10642 const roughNode = rc.circle(0, 0, radius * 2, options);
10643 const circleElem = shapeSvg.insert(() => roughNode, ":first-child");
10644 circleElem.attr("class", "anchor").attr("style", (0,_chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .handleUndefinedAttr */ .R7)(cssStyles));
10645 updateNodeBounds(node, circleElem);
10646 node.intersect = function(point) {
10647 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .cM.info("Circle intersect", node, radius, point);
10648 return intersect_default.circle(node, radius, point);
10649 };
10650 return shapeSvg;
10651 }
10652 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(anchor, "anchor");
10653
10654 // src/rendering-util/rendering-elements/shapes/bowTieRect.ts
10655
10656 function generateArcPoints(x1, y1, x2, y2, rx, ry, clockwise) {
10657 const numPoints = 20;
10658 const midX = (x1 + x2) / 2;
10659 const midY = (y1 + y2) / 2;
10660 const angle = Math.atan2(y2 - y1, x2 - x1);
10661 const dx = (x2 - x1) / 2;
10662 const dy = (y2 - y1) / 2;
10663 const transformedX = dx / rx;
10664 const transformedY = dy / ry;
10665 const distance = Math.sqrt(transformedX ** 2 + transformedY ** 2);
10666 if (distance > 1) {
10667 throw new Error("The given radii are too small to create an arc between the points.");
10668 }
10669 const scaledCenterDistance = Math.sqrt(1 - distance ** 2);
10670 const centerX = midX + scaledCenterDistance * ry * Math.sin(angle) * (clockwise ? -1 : 1);
10671 const centerY = midY - scaledCenterDistance * rx * Math.cos(angle) * (clockwise ? -1 : 1);
10672 const startAngle = Math.atan2((y1 - centerY) / ry, (x1 - centerX) / rx);
10673 const endAngle = Math.atan2((y2 - centerY) / ry, (x2 - centerX) / rx);
10674 let angleRange = endAngle - startAngle;
10675 if (clockwise && angleRange < 0) {
10676 angleRange += 2 * Math.PI;
10677 }
10678 if (!clockwise && angleRange > 0) {
10679 angleRange -= 2 * Math.PI;
10680 }
10681 const points = [];
10682 for (let i = 0; i < numPoints; i++) {
10683 const t = i / (numPoints - 1);
10684 const angle2 = startAngle + t * angleRange;
10685 const x = centerX + rx * Math.cos(angle2);
10686 const y = centerY + ry * Math.sin(angle2);
10687 points.push({ x, y });
10688 }
10689 return points;
10690 }
10691 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(generateArcPoints, "generateArcPoints");
10692 async function bowTieRect(parent, node) {
10693 const { labelStyles, nodeStyles } = styles2String(node);
10694 node.labelStyle = labelStyles;
10695 const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));
10696 const w = bbox.width + node.padding + 20;
10697 const h = bbox.height + node.padding;
10698 const ry = h / 2;
10699 const rx = ry / (2.5 + h / 50);
10700 const { cssStyles } = node;
10701 const points = [
10702 { x: w / 2, y: -h / 2 },
10703 { x: -w / 2, y: -h / 2 },
10704 ...generateArcPoints(-w / 2, -h / 2, -w / 2, h / 2, rx, ry, false),
10705 { x: w / 2, y: h / 2 },
10706 ...generateArcPoints(w / 2, h / 2, w / 2, -h / 2, rx, ry, true)
10707 ];
10708 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
10709 const options = userNodeOverrides(node, {});
10710 if (node.look !== "handDrawn") {
10711 options.roughness = 0;
10712 options.fillStyle = "solid";
10713 }
10714 const bowTieRectPath = createPathFromPoints(points);
10715 const bowTieRectShapePath = rc.path(bowTieRectPath, options);
10716 const bowTieRectShape = shapeSvg.insert(() => bowTieRectShapePath, ":first-child");
10717 bowTieRectShape.attr("class", "basic label-container");
10718 if (cssStyles && node.look !== "handDrawn") {
10719 bowTieRectShape.selectAll("path").attr("style", cssStyles);
10720 }
10721 if (nodeStyles && node.look !== "handDrawn") {
10722 bowTieRectShape.selectAll("path").attr("style", nodeStyles);
10723 }
10724 bowTieRectShape.attr("transform", `translate(${rx / 2}, 0)`);
10725 updateNodeBounds(node, bowTieRectShape);
10726 node.intersect = function(point) {
10727 const pos = intersect_default.polygon(node, points, point);
10728 return pos;
10729 };
10730 return shapeSvg;
10731 }
10732 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(bowTieRect, "bowTieRect");
10733
10734 // src/rendering-util/rendering-elements/shapes/card.ts
10735
10736
10737 // src/rendering-util/rendering-elements/shapes/insertPolygonShape.ts
10738 function insertPolygonShape(parent, w, h, points) {
10739 return parent.insert("polygon", ":first-child").attr(
10740 "points",
10741 points.map(function(d) {
10742 return d.x + "," + d.y;
10743 }).join(" ")
10744 ).attr("class", "label-container").attr("transform", "translate(" + -w / 2 + "," + h / 2 + ")");
10745 }
10746 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(insertPolygonShape, "insertPolygonShape");
10747
10748 // src/rendering-util/rendering-elements/shapes/card.ts
10749 async function card(parent, node) {
10750 const { labelStyles, nodeStyles } = styles2String(node);
10751 node.labelStyle = labelStyles;
10752 const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));
10753 const h = bbox.height + node.padding;
10754 const padding = 12;
10755 const w = bbox.width + node.padding + padding;
10756 const left = 0;
10757 const right = w;
10758 const top = -h;
10759 const bottom = 0;
10760 const points = [
10761 { x: left + padding, y: top },
10762 { x: right, y: top },
10763 { x: right, y: bottom },
10764 { x: left, y: bottom },
10765 { x: left, y: top + padding },
10766 { x: left + padding, y: top }
10767 ];
10768 let polygon;
10769 const { cssStyles } = node;
10770 if (node.look === "handDrawn") {
10771 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
10772 const options = userNodeOverrides(node, {});
10773 const pathData = createPathFromPoints(points);
10774 const roughNode = rc.path(pathData, options);
10775 polygon = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-w / 2}, ${h / 2})`);
10776 if (cssStyles) {
10777 polygon.attr("style", cssStyles);
10778 }
10779 } else {
10780 polygon = insertPolygonShape(shapeSvg, w, h, points);
10781 }
10782 if (nodeStyles) {
10783 polygon.attr("style", nodeStyles);
10784 }
10785 updateNodeBounds(node, polygon);
10786 node.intersect = function(point) {
10787 return intersect_default.polygon(node, points, point);
10788 };
10789 return shapeSvg;
10790 }
10791 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(card, "card");
10792
10793 // src/rendering-util/rendering-elements/shapes/choice.ts
10794
10795 function choice(parent, node) {
10796 const { nodeStyles } = styles2String(node);
10797 node.label = "";
10798 const shapeSvg = parent.insert("g").attr("class", getNodeClasses(node)).attr("id", node.domId ?? node.id);
10799 const { cssStyles } = node;
10800 const s = Math.max(28, node.width ?? 0);
10801 const points = [
10802 { x: 0, y: s / 2 },
10803 { x: s / 2, y: 0 },
10804 { x: 0, y: -s / 2 },
10805 { x: -s / 2, y: 0 }
10806 ];
10807 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
10808 const options = userNodeOverrides(node, {});
10809 if (node.look !== "handDrawn") {
10810 options.roughness = 0;
10811 options.fillStyle = "solid";
10812 }
10813 const choicePath = createPathFromPoints(points);
10814 const roughNode = rc.path(choicePath, options);
10815 const choiceShape = shapeSvg.insert(() => roughNode, ":first-child");
10816 if (cssStyles && node.look !== "handDrawn") {
10817 choiceShape.selectAll("path").attr("style", cssStyles);
10818 }
10819 if (nodeStyles && node.look !== "handDrawn") {
10820 choiceShape.selectAll("path").attr("style", nodeStyles);
10821 }
10822 node.width = 28;
10823 node.height = 28;
10824 node.intersect = function(point) {
10825 return intersect_default.polygon(node, points, point);
10826 };
10827 return shapeSvg;
10828 }
10829 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(choice, "choice");
10830
10831 // src/rendering-util/rendering-elements/shapes/circle.ts
10832
10833 async function circle(parent, node) {
10834 const { labelStyles, nodeStyles } = styles2String(node);
10835 node.labelStyle = labelStyles;
10836 const { shapeSvg, bbox, halfPadding } = await labelHelper(parent, node, getNodeClasses(node));
10837 const radius = bbox.width / 2 + halfPadding;
10838 let circleElem;
10839 const { cssStyles } = node;
10840 if (node.look === "handDrawn") {
10841 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
10842 const options = userNodeOverrides(node, {});
10843 const roughNode = rc.circle(0, 0, radius * 2, options);
10844 circleElem = shapeSvg.insert(() => roughNode, ":first-child");
10845 circleElem.attr("class", "basic label-container").attr("style", (0,_chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .handleUndefinedAttr */ .R7)(cssStyles));
10846 } else {
10847 circleElem = shapeSvg.insert("circle", ":first-child").attr("class", "basic label-container").attr("style", nodeStyles).attr("r", radius).attr("cx", 0).attr("cy", 0);
10848 }
10849 updateNodeBounds(node, circleElem);
10850 node.intersect = function(point) {
10851 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .cM.info("Circle intersect", node, radius, point);
10852 return intersect_default.circle(node, radius, point);
10853 };
10854 return shapeSvg;
10855 }
10856 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(circle, "circle");
10857
10858 // src/rendering-util/rendering-elements/shapes/crossedCircle.ts
10859
10860 function createLine(r) {
10861 const xAxis45 = Math.cos(Math.PI / 4);
10862 const yAxis45 = Math.sin(Math.PI / 4);
10863 const lineLength = r * 2;
10864 const pointQ1 = { x: lineLength / 2 * xAxis45, y: lineLength / 2 * yAxis45 };
10865 const pointQ2 = { x: -(lineLength / 2) * xAxis45, y: lineLength / 2 * yAxis45 };
10866 const pointQ3 = { x: -(lineLength / 2) * xAxis45, y: -(lineLength / 2) * yAxis45 };
10867 const pointQ4 = { x: lineLength / 2 * xAxis45, y: -(lineLength / 2) * yAxis45 };
10868 return `M ${pointQ2.x},${pointQ2.y} L ${pointQ4.x},${pointQ4.y}
10869 M ${pointQ1.x},${pointQ1.y} L ${pointQ3.x},${pointQ3.y}`;
10870 }
10871 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(createLine, "createLine");
10872 function crossedCircle(parent, node) {
10873 const { labelStyles, nodeStyles } = styles2String(node);
10874 node.labelStyle = labelStyles;
10875 node.label = "";
10876 const shapeSvg = parent.insert("g").attr("class", getNodeClasses(node)).attr("id", node.domId ?? node.id);
10877 const radius = Math.max(30, node?.width ?? 0);
10878 const { cssStyles } = node;
10879 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
10880 const options = userNodeOverrides(node, {});
10881 if (node.look !== "handDrawn") {
10882 options.roughness = 0;
10883 options.fillStyle = "solid";
10884 }
10885 const circleNode = rc.circle(0, 0, radius * 2, options);
10886 const linePath = createLine(radius);
10887 const lineNode = rc.path(linePath, options);
10888 const crossedCircle2 = shapeSvg.insert(() => circleNode, ":first-child");
10889 crossedCircle2.insert(() => lineNode);
10890 if (cssStyles && node.look !== "handDrawn") {
10891 crossedCircle2.selectAll("path").attr("style", cssStyles);
10892 }
10893 if (nodeStyles && node.look !== "handDrawn") {
10894 crossedCircle2.selectAll("path").attr("style", nodeStyles);
10895 }
10896 updateNodeBounds(node, crossedCircle2);
10897 node.intersect = function(point) {
10898 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .cM.info("crossedCircle intersect", node, { radius, point });
10899 const pos = intersect_default.circle(node, radius, point);
10900 return pos;
10901 };
10902 return shapeSvg;
10903 }
10904 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(crossedCircle, "crossedCircle");
10905
10906 // src/rendering-util/rendering-elements/shapes/curlyBraceLeft.ts
10907
10908 function generateCirclePoints2(centerX, centerY, radius, numPoints = 100, startAngle = 0, endAngle = 180) {
10909 const points = [];
10910 const startAngleRad = startAngle * Math.PI / 180;
10911 const endAngleRad = endAngle * Math.PI / 180;
10912 const angleRange = endAngleRad - startAngleRad;
10913 const angleStep = angleRange / (numPoints - 1);
10914 for (let i = 0; i < numPoints; i++) {
10915 const angle = startAngleRad + i * angleStep;
10916 const x = centerX + radius * Math.cos(angle);
10917 const y = centerY + radius * Math.sin(angle);
10918 points.push({ x: -x, y: -y });
10919 }
10920 return points;
10921 }
10922 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(generateCirclePoints2, "generateCirclePoints");
10923 async function curlyBraceLeft(parent, node) {
10924 const { labelStyles, nodeStyles } = styles2String(node);
10925 node.labelStyle = labelStyles;
10926 const { shapeSvg, bbox, label } = await labelHelper(parent, node, getNodeClasses(node));
10927 const w = bbox.width + (node.padding ?? 0);
10928 const h = bbox.height + (node.padding ?? 0);
10929 const radius = Math.max(5, h * 0.1);
10930 const { cssStyles } = node;
10931 const points = [
10932 ...generateCirclePoints2(w / 2, -h / 2, radius, 30, -90, 0),
10933 { x: -w / 2 - radius, y: radius },
10934 ...generateCirclePoints2(w / 2 + radius * 2, -radius, radius, 20, -180, -270),
10935 ...generateCirclePoints2(w / 2 + radius * 2, radius, radius, 20, -90, -180),
10936 { x: -w / 2 - radius, y: -h / 2 },
10937 ...generateCirclePoints2(w / 2, h / 2, radius, 20, 0, 90)
10938 ];
10939 const rectPoints = [
10940 { x: w / 2, y: -h / 2 - radius },
10941 { x: -w / 2, y: -h / 2 - radius },
10942 ...generateCirclePoints2(w / 2, -h / 2, radius, 20, -90, 0),
10943 { x: -w / 2 - radius, y: -radius },
10944 ...generateCirclePoints2(w / 2 + w * 0.1, -radius, radius, 20, -180, -270),
10945 ...generateCirclePoints2(w / 2 + w * 0.1, radius, radius, 20, -90, -180),
10946 { x: -w / 2 - radius, y: h / 2 },
10947 ...generateCirclePoints2(w / 2, h / 2, radius, 20, 0, 90),
10948 { x: -w / 2, y: h / 2 + radius },
10949 { x: w / 2, y: h / 2 + radius }
10950 ];
10951 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
10952 const options = userNodeOverrides(node, { fill: "none" });
10953 if (node.look !== "handDrawn") {
10954 options.roughness = 0;
10955 options.fillStyle = "solid";
10956 }
10957 const curlyBraceLeftPath = createPathFromPoints(points);
10958 const newCurlyBracePath = curlyBraceLeftPath.replace("Z", "");
10959 const curlyBraceLeftNode = rc.path(newCurlyBracePath, options);
10960 const rectPath = createPathFromPoints(rectPoints);
10961 const rectShape = rc.path(rectPath, { ...options });
10962 const curlyBraceLeftShape = shapeSvg.insert("g", ":first-child");
10963 curlyBraceLeftShape.insert(() => rectShape, ":first-child").attr("stroke-opacity", 0);
10964 curlyBraceLeftShape.insert(() => curlyBraceLeftNode, ":first-child");
10965 curlyBraceLeftShape.attr("class", "text");
10966 if (cssStyles && node.look !== "handDrawn") {
10967 curlyBraceLeftShape.selectAll("path").attr("style", cssStyles);
10968 }
10969 if (nodeStyles && node.look !== "handDrawn") {
10970 curlyBraceLeftShape.selectAll("path").attr("style", nodeStyles);
10971 }
10972 curlyBraceLeftShape.attr("transform", `translate(${radius}, 0)`);
10973 label.attr(
10974 "transform",
10975 `translate(${-w / 2 + radius - (bbox.x - (bbox.left ?? 0))},${-h / 2 + (node.padding ?? 0) / 2 - (bbox.y - (bbox.top ?? 0))})`
10976 );
10977 updateNodeBounds(node, curlyBraceLeftShape);
10978 node.intersect = function(point) {
10979 const pos = intersect_default.polygon(node, rectPoints, point);
10980 return pos;
10981 };
10982 return shapeSvg;
10983 }
10984 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(curlyBraceLeft, "curlyBraceLeft");
10985
10986 // src/rendering-util/rendering-elements/shapes/curlyBraceRight.ts
10987
10988 function generateCirclePoints3(centerX, centerY, radius, numPoints = 100, startAngle = 0, endAngle = 180) {
10989 const points = [];
10990 const startAngleRad = startAngle * Math.PI / 180;
10991 const endAngleRad = endAngle * Math.PI / 180;
10992 const angleRange = endAngleRad - startAngleRad;
10993 const angleStep = angleRange / (numPoints - 1);
10994 for (let i = 0; i < numPoints; i++) {
10995 const angle = startAngleRad + i * angleStep;
10996 const x = centerX + radius * Math.cos(angle);
10997 const y = centerY + radius * Math.sin(angle);
10998 points.push({ x, y });
10999 }
11000 return points;
11001 }
11002 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(generateCirclePoints3, "generateCirclePoints");
11003 async function curlyBraceRight(parent, node) {
11004 const { labelStyles, nodeStyles } = styles2String(node);
11005 node.labelStyle = labelStyles;
11006 const { shapeSvg, bbox, label } = await labelHelper(parent, node, getNodeClasses(node));
11007 const w = bbox.width + (node.padding ?? 0);
11008 const h = bbox.height + (node.padding ?? 0);
11009 const radius = Math.max(5, h * 0.1);
11010 const { cssStyles } = node;
11011 const points = [
11012 ...generateCirclePoints3(w / 2, -h / 2, radius, 20, -90, 0),
11013 { x: w / 2 + radius, y: -radius },
11014 ...generateCirclePoints3(w / 2 + radius * 2, -radius, radius, 20, -180, -270),
11015 ...generateCirclePoints3(w / 2 + radius * 2, radius, radius, 20, -90, -180),
11016 { x: w / 2 + radius, y: h / 2 },
11017 ...generateCirclePoints3(w / 2, h / 2, radius, 20, 0, 90)
11018 ];
11019 const rectPoints = [
11020 { x: -w / 2, y: -h / 2 - radius },
11021 { x: w / 2, y: -h / 2 - radius },
11022 ...generateCirclePoints3(w / 2, -h / 2, radius, 20, -90, 0),
11023 { x: w / 2 + radius, y: -radius },
11024 ...generateCirclePoints3(w / 2 + radius * 2, -radius, radius, 20, -180, -270),
11025 ...generateCirclePoints3(w / 2 + radius * 2, radius, radius, 20, -90, -180),
11026 { x: w / 2 + radius, y: h / 2 },
11027 ...generateCirclePoints3(w / 2, h / 2, radius, 20, 0, 90),
11028 { x: w / 2, y: h / 2 + radius },
11029 { x: -w / 2, y: h / 2 + radius }
11030 ];
11031 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
11032 const options = userNodeOverrides(node, { fill: "none" });
11033 if (node.look !== "handDrawn") {
11034 options.roughness = 0;
11035 options.fillStyle = "solid";
11036 }
11037 const curlyBraceRightPath = createPathFromPoints(points);
11038 const newCurlyBracePath = curlyBraceRightPath.replace("Z", "");
11039 const curlyBraceRightNode = rc.path(newCurlyBracePath, options);
11040 const rectPath = createPathFromPoints(rectPoints);
11041 const rectShape = rc.path(rectPath, { ...options });
11042 const curlyBraceRightShape = shapeSvg.insert("g", ":first-child");
11043 curlyBraceRightShape.insert(() => rectShape, ":first-child").attr("stroke-opacity", 0);
11044 curlyBraceRightShape.insert(() => curlyBraceRightNode, ":first-child");
11045 curlyBraceRightShape.attr("class", "text");
11046 if (cssStyles && node.look !== "handDrawn") {
11047 curlyBraceRightShape.selectAll("path").attr("style", cssStyles);
11048 }
11049 if (nodeStyles && node.look !== "handDrawn") {
11050 curlyBraceRightShape.selectAll("path").attr("style", nodeStyles);
11051 }
11052 curlyBraceRightShape.attr("transform", `translate(${-radius}, 0)`);
11053 label.attr(
11054 "transform",
11055 `translate(${-w / 2 + (node.padding ?? 0) / 2 - (bbox.x - (bbox.left ?? 0))},${-h / 2 + (node.padding ?? 0) / 2 - (bbox.y - (bbox.top ?? 0))})`
11056 );
11057 updateNodeBounds(node, curlyBraceRightShape);
11058 node.intersect = function(point) {
11059 const pos = intersect_default.polygon(node, rectPoints, point);
11060 return pos;
11061 };
11062 return shapeSvg;
11063 }
11064 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(curlyBraceRight, "curlyBraceRight");
11065
11066 // src/rendering-util/rendering-elements/shapes/curlyBraces.ts
11067
11068 function generateCirclePoints4(centerX, centerY, radius, numPoints = 100, startAngle = 0, endAngle = 180) {
11069 const points = [];
11070 const startAngleRad = startAngle * Math.PI / 180;
11071 const endAngleRad = endAngle * Math.PI / 180;
11072 const angleRange = endAngleRad - startAngleRad;
11073 const angleStep = angleRange / (numPoints - 1);
11074 for (let i = 0; i < numPoints; i++) {
11075 const angle = startAngleRad + i * angleStep;
11076 const x = centerX + radius * Math.cos(angle);
11077 const y = centerY + radius * Math.sin(angle);
11078 points.push({ x: -x, y: -y });
11079 }
11080 return points;
11081 }
11082 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(generateCirclePoints4, "generateCirclePoints");
11083 async function curlyBraces(parent, node) {
11084 const { labelStyles, nodeStyles } = styles2String(node);
11085 node.labelStyle = labelStyles;
11086 const { shapeSvg, bbox, label } = await labelHelper(parent, node, getNodeClasses(node));
11087 const w = bbox.width + (node.padding ?? 0);
11088 const h = bbox.height + (node.padding ?? 0);
11089 const radius = Math.max(5, h * 0.1);
11090 const { cssStyles } = node;
11091 const leftCurlyBracePoints = [
11092 ...generateCirclePoints4(w / 2, -h / 2, radius, 30, -90, 0),
11093 { x: -w / 2 - radius, y: radius },
11094 ...generateCirclePoints4(w / 2 + radius * 2, -radius, radius, 20, -180, -270),
11095 ...generateCirclePoints4(w / 2 + radius * 2, radius, radius, 20, -90, -180),
11096 { x: -w / 2 - radius, y: -h / 2 },
11097 ...generateCirclePoints4(w / 2, h / 2, radius, 20, 0, 90)
11098 ];
11099 const rightCurlyBracePoints = [
11100 ...generateCirclePoints4(-w / 2 + radius + radius / 2, -h / 2, radius, 20, -90, -180),
11101 { x: w / 2 - radius / 2, y: radius },
11102 ...generateCirclePoints4(-w / 2 - radius / 2, -radius, radius, 20, 0, 90),
11103 ...generateCirclePoints4(-w / 2 - radius / 2, radius, radius, 20, -90, 0),
11104 { x: w / 2 - radius / 2, y: -radius },
11105 ...generateCirclePoints4(-w / 2 + radius + radius / 2, h / 2, radius, 30, -180, -270)
11106 ];
11107 const rectPoints = [
11108 { x: w / 2, y: -h / 2 - radius },
11109 { x: -w / 2, y: -h / 2 - radius },
11110 ...generateCirclePoints4(w / 2, -h / 2, radius, 20, -90, 0),
11111 { x: -w / 2 - radius, y: -radius },
11112 ...generateCirclePoints4(w / 2 + radius * 2, -radius, radius, 20, -180, -270),
11113 ...generateCirclePoints4(w / 2 + radius * 2, radius, radius, 20, -90, -180),
11114 { x: -w / 2 - radius, y: h / 2 },
11115 ...generateCirclePoints4(w / 2, h / 2, radius, 20, 0, 90),
11116 { x: -w / 2, y: h / 2 + radius },
11117 { x: w / 2 - radius - radius / 2, y: h / 2 + radius },
11118 ...generateCirclePoints4(-w / 2 + radius + radius / 2, -h / 2, radius, 20, -90, -180),
11119 { x: w / 2 - radius / 2, y: radius },
11120 ...generateCirclePoints4(-w / 2 - radius / 2, -radius, radius, 20, 0, 90),
11121 ...generateCirclePoints4(-w / 2 - radius / 2, radius, radius, 20, -90, 0),
11122 { x: w / 2 - radius / 2, y: -radius },
11123 ...generateCirclePoints4(-w / 2 + radius + radius / 2, h / 2, radius, 30, -180, -270)
11124 ];
11125 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
11126 const options = userNodeOverrides(node, { fill: "none" });
11127 if (node.look !== "handDrawn") {
11128 options.roughness = 0;
11129 options.fillStyle = "solid";
11130 }
11131 const leftCurlyBracePath = createPathFromPoints(leftCurlyBracePoints);
11132 const newLeftCurlyBracePath = leftCurlyBracePath.replace("Z", "");
11133 const leftCurlyBraceNode = rc.path(newLeftCurlyBracePath, options);
11134 const rightCurlyBracePath = createPathFromPoints(rightCurlyBracePoints);
11135 const newRightCurlyBracePath = rightCurlyBracePath.replace("Z", "");
11136 const rightCurlyBraceNode = rc.path(newRightCurlyBracePath, options);
11137 const rectPath = createPathFromPoints(rectPoints);
11138 const rectShape = rc.path(rectPath, { ...options });
11139 const curlyBracesShape = shapeSvg.insert("g", ":first-child");
11140 curlyBracesShape.insert(() => rectShape, ":first-child").attr("stroke-opacity", 0);
11141 curlyBracesShape.insert(() => leftCurlyBraceNode, ":first-child");
11142 curlyBracesShape.insert(() => rightCurlyBraceNode, ":first-child");
11143 curlyBracesShape.attr("class", "text");
11144 if (cssStyles && node.look !== "handDrawn") {
11145 curlyBracesShape.selectAll("path").attr("style", cssStyles);
11146 }
11147 if (nodeStyles && node.look !== "handDrawn") {
11148 curlyBracesShape.selectAll("path").attr("style", nodeStyles);
11149 }
11150 curlyBracesShape.attr("transform", `translate(${radius - radius / 4}, 0)`);
11151 label.attr(
11152 "transform",
11153 `translate(${-w / 2 + (node.padding ?? 0) / 2 - (bbox.x - (bbox.left ?? 0))},${-h / 2 + (node.padding ?? 0) / 2 - (bbox.y - (bbox.top ?? 0))})`
11154 );
11155 updateNodeBounds(node, curlyBracesShape);
11156 node.intersect = function(point) {
11157 const pos = intersect_default.polygon(node, rectPoints, point);
11158 return pos;
11159 };
11160 return shapeSvg;
11161 }
11162 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(curlyBraces, "curlyBraces");
11163
11164 // src/rendering-util/rendering-elements/shapes/curvedTrapezoid.ts
11165
11166 async function curvedTrapezoid(parent, node) {
11167 const { labelStyles, nodeStyles } = styles2String(node);
11168 node.labelStyle = labelStyles;
11169 const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));
11170 const minWidth = 80, minHeight = 20;
11171 const w = Math.max(minWidth, (bbox.width + (node.padding ?? 0) * 2) * 1.25, node?.width ?? 0);
11172 const h = Math.max(minHeight, bbox.height + (node.padding ?? 0) * 2, node?.height ?? 0);
11173 const radius = h / 2;
11174 const { cssStyles } = node;
11175 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
11176 const options = userNodeOverrides(node, {});
11177 if (node.look !== "handDrawn") {
11178 options.roughness = 0;
11179 options.fillStyle = "solid";
11180 }
11181 const totalWidth = w, totalHeight = h;
11182 const rw = totalWidth - radius;
11183 const tw = totalHeight / 4;
11184 const points = [
11185 { x: rw, y: 0 },
11186 { x: tw, y: 0 },
11187 { x: 0, y: totalHeight / 2 },
11188 { x: tw, y: totalHeight },
11189 { x: rw, y: totalHeight },
11190 ...generateCirclePoints(-rw, -totalHeight / 2, radius, 50, 270, 90)
11191 ];
11192 const pathData = createPathFromPoints(points);
11193 const shapeNode = rc.path(pathData, options);
11194 const polygon = shapeSvg.insert(() => shapeNode, ":first-child");
11195 polygon.attr("class", "basic label-container");
11196 if (cssStyles && node.look !== "handDrawn") {
11197 polygon.selectChildren("path").attr("style", cssStyles);
11198 }
11199 if (nodeStyles && node.look !== "handDrawn") {
11200 polygon.selectChildren("path").attr("style", nodeStyles);
11201 }
11202 polygon.attr("transform", `translate(${-w / 2}, ${-h / 2})`);
11203 updateNodeBounds(node, polygon);
11204 node.intersect = function(point) {
11205 const pos = intersect_default.polygon(node, points, point);
11206 return pos;
11207 };
11208 return shapeSvg;
11209 }
11210 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(curvedTrapezoid, "curvedTrapezoid");
11211
11212 // src/rendering-util/rendering-elements/shapes/cylinder.ts
11213
11214 var createCylinderPathD = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)((x, y, width, height, rx, ry) => {
11215 return [
11216 `M${x},${y + ry}`,
11217 `a${rx},${ry} 0,0,0 ${width},0`,
11218 `a${rx},${ry} 0,0,0 ${-width},0`,
11219 `l0,${height}`,
11220 `a${rx},${ry} 0,0,0 ${width},0`,
11221 `l0,${-height}`
11222 ].join(" ");
11223 }, "createCylinderPathD");
11224 var createOuterCylinderPathD = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)((x, y, width, height, rx, ry) => {
11225 return [
11226 `M${x},${y + ry}`,
11227 `M${x + width},${y + ry}`,
11228 `a${rx},${ry} 0,0,0 ${-width},0`,
11229 `l0,${height}`,
11230 `a${rx},${ry} 0,0,0 ${width},0`,
11231 `l0,${-height}`
11232 ].join(" ");
11233 }, "createOuterCylinderPathD");
11234 var createInnerCylinderPathD = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)((x, y, width, height, rx, ry) => {
11235 return [`M${x - width / 2},${-height / 2}`, `a${rx},${ry} 0,0,0 ${width},0`].join(" ");
11236 }, "createInnerCylinderPathD");
11237 async function cylinder(parent, node) {
11238 const { labelStyles, nodeStyles } = styles2String(node);
11239 node.labelStyle = labelStyles;
11240 const { shapeSvg, bbox, label } = await labelHelper(parent, node, getNodeClasses(node));
11241 const w = Math.max(bbox.width + node.padding, node.width ?? 0);
11242 const rx = w / 2;
11243 const ry = rx / (2.5 + w / 50);
11244 const h = Math.max(bbox.height + ry + node.padding, node.height ?? 0);
11245 let cylinder2;
11246 const { cssStyles } = node;
11247 if (node.look === "handDrawn") {
11248 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
11249 const outerPathData = createOuterCylinderPathD(0, 0, w, h, rx, ry);
11250 const innerPathData = createInnerCylinderPathD(0, ry, w, h, rx, ry);
11251 const outerNode = rc.path(outerPathData, userNodeOverrides(node, {}));
11252 const innerLine = rc.path(innerPathData, userNodeOverrides(node, { fill: "none" }));
11253 cylinder2 = shapeSvg.insert(() => innerLine, ":first-child");
11254 cylinder2 = shapeSvg.insert(() => outerNode, ":first-child");
11255 cylinder2.attr("class", "basic label-container");
11256 if (cssStyles) {
11257 cylinder2.attr("style", cssStyles);
11258 }
11259 } else {
11260 const pathData = createCylinderPathD(0, 0, w, h, rx, ry);
11261 cylinder2 = shapeSvg.insert("path", ":first-child").attr("d", pathData).attr("class", "basic label-container").attr("style", (0,_chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .handleUndefinedAttr */ .R7)(cssStyles)).attr("style", nodeStyles);
11262 }
11263 cylinder2.attr("label-offset-y", ry);
11264 cylinder2.attr("transform", `translate(${-w / 2}, ${-(h / 2 + ry)})`);
11265 updateNodeBounds(node, cylinder2);
11266 label.attr(
11267 "transform",
11268 `translate(${-(bbox.width / 2) - (bbox.x - (bbox.left ?? 0))}, ${-(bbox.height / 2) + (node.padding ?? 0) / 1.5 - (bbox.y - (bbox.top ?? 0))})`
11269 );
11270 node.intersect = function(point) {
11271 const pos = intersect_default.rect(node, point);
11272 const x = pos.x - (node.x ?? 0);
11273 if (rx != 0 && (Math.abs(x) < (node.width ?? 0) / 2 || Math.abs(x) == (node.width ?? 0) / 2 && Math.abs(pos.y - (node.y ?? 0)) > (node.height ?? 0) / 2 - ry)) {
11274 let y = ry * ry * (1 - x * x / (rx * rx));
11275 if (y > 0) {
11276 y = Math.sqrt(y);
11277 }
11278 y = ry - y;
11279 if (point.y - (node.y ?? 0) > 0) {
11280 y = -y;
11281 }
11282 pos.y += y;
11283 }
11284 return pos;
11285 };
11286 return shapeSvg;
11287 }
11288 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(cylinder, "cylinder");
11289
11290 // src/rendering-util/rendering-elements/shapes/dividedRect.ts
11291
11292 async function dividedRectangle(parent, node) {
11293 const { labelStyles, nodeStyles } = styles2String(node);
11294 node.labelStyle = labelStyles;
11295 const { shapeSvg, bbox, label } = await labelHelper(parent, node, getNodeClasses(node));
11296 const w = bbox.width + node.padding;
11297 const h = bbox.height + node.padding;
11298 const rectOffset = h * 0.2;
11299 const x = -w / 2;
11300 const y = -h / 2 - rectOffset / 2;
11301 const { cssStyles } = node;
11302 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
11303 const options = userNodeOverrides(node, {});
11304 if (node.look !== "handDrawn") {
11305 options.roughness = 0;
11306 options.fillStyle = "solid";
11307 }
11308 const pts = [
11309 { x, y: y + rectOffset },
11310 { x: -x, y: y + rectOffset },
11311 { x: -x, y: -y },
11312 { x, y: -y },
11313 { x, y },
11314 { x: -x, y },
11315 { x: -x, y: y + rectOffset }
11316 ];
11317 const poly = rc.polygon(
11318 pts.map((p) => [p.x, p.y]),
11319 options
11320 );
11321 const polygon = shapeSvg.insert(() => poly, ":first-child");
11322 polygon.attr("class", "basic label-container");
11323 if (cssStyles && node.look !== "handDrawn") {
11324 polygon.selectAll("path").attr("style", cssStyles);
11325 }
11326 if (nodeStyles && node.look !== "handDrawn") {
11327 polygon.selectAll("path").attr("style", nodeStyles);
11328 }
11329 label.attr(
11330 "transform",
11331 `translate(${x + (node.padding ?? 0) / 2 - (bbox.x - (bbox.left ?? 0))}, ${y + rectOffset + (node.padding ?? 0) / 2 - (bbox.y - (bbox.top ?? 0))})`
11332 );
11333 updateNodeBounds(node, polygon);
11334 node.intersect = function(point) {
11335 const pos = intersect_default.rect(node, point);
11336 return pos;
11337 };
11338 return shapeSvg;
11339 }
11340 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(dividedRectangle, "dividedRectangle");
11341
11342 // src/rendering-util/rendering-elements/shapes/doubleCircle.ts
11343
11344 async function doublecircle(parent, node) {
11345 const { labelStyles, nodeStyles } = styles2String(node);
11346 node.labelStyle = labelStyles;
11347 const { shapeSvg, bbox, halfPadding } = await labelHelper(parent, node, getNodeClasses(node));
11348 const gap = 5;
11349 const outerRadius = bbox.width / 2 + halfPadding + gap;
11350 const innerRadius = bbox.width / 2 + halfPadding;
11351 let circleGroup;
11352 const { cssStyles } = node;
11353 if (node.look === "handDrawn") {
11354 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
11355 const outerOptions = userNodeOverrides(node, { roughness: 0.2, strokeWidth: 2.5 });
11356 const innerOptions = userNodeOverrides(node, { roughness: 0.2, strokeWidth: 1.5 });
11357 const outerRoughNode = rc.circle(0, 0, outerRadius * 2, outerOptions);
11358 const innerRoughNode = rc.circle(0, 0, innerRadius * 2, innerOptions);
11359 circleGroup = shapeSvg.insert("g", ":first-child");
11360 circleGroup.attr("class", (0,_chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .handleUndefinedAttr */ .R7)(node.cssClasses)).attr("style", (0,_chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .handleUndefinedAttr */ .R7)(cssStyles));
11361 circleGroup.node()?.appendChild(outerRoughNode);
11362 circleGroup.node()?.appendChild(innerRoughNode);
11363 } else {
11364 circleGroup = shapeSvg.insert("g", ":first-child");
11365 const outerCircle = circleGroup.insert("circle", ":first-child");
11366 const innerCircle = circleGroup.insert("circle");
11367 circleGroup.attr("class", "basic label-container").attr("style", nodeStyles);
11368 outerCircle.attr("class", "outer-circle").attr("style", nodeStyles).attr("r", outerRadius).attr("cx", 0).attr("cy", 0);
11369 innerCircle.attr("class", "inner-circle").attr("style", nodeStyles).attr("r", innerRadius).attr("cx", 0).attr("cy", 0);
11370 }
11371 updateNodeBounds(node, circleGroup);
11372 node.intersect = function(point) {
11373 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .cM.info("DoubleCircle intersect", node, outerRadius, point);
11374 return intersect_default.circle(node, outerRadius, point);
11375 };
11376 return shapeSvg;
11377 }
11378 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(doublecircle, "doublecircle");
11379
11380 // src/rendering-util/rendering-elements/shapes/filledCircle.ts
11381
11382 function filledCircle(parent, node, { config: { themeVariables } }) {
11383 const { labelStyles, nodeStyles } = styles2String(node);
11384 node.label = "";
11385 node.labelStyle = labelStyles;
11386 const shapeSvg = parent.insert("g").attr("class", getNodeClasses(node)).attr("id", node.domId ?? node.id);
11387 const radius = 7;
11388 const { cssStyles } = node;
11389 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
11390 const { nodeBorder } = themeVariables;
11391 const options = userNodeOverrides(node, { fillStyle: "solid" });
11392 if (node.look !== "handDrawn") {
11393 options.roughness = 0;
11394 }
11395 const circleNode = rc.circle(0, 0, radius * 2, options);
11396 const filledCircle2 = shapeSvg.insert(() => circleNode, ":first-child");
11397 filledCircle2.selectAll("path").attr("style", `fill: ${nodeBorder} !important;`);
11398 if (cssStyles && cssStyles.length > 0 && node.look !== "handDrawn") {
11399 filledCircle2.selectAll("path").attr("style", cssStyles);
11400 }
11401 if (nodeStyles && node.look !== "handDrawn") {
11402 filledCircle2.selectAll("path").attr("style", nodeStyles);
11403 }
11404 updateNodeBounds(node, filledCircle2);
11405 node.intersect = function(point) {
11406 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .cM.info("filledCircle intersect", node, { radius, point });
11407 const pos = intersect_default.circle(node, radius, point);
11408 return pos;
11409 };
11410 return shapeSvg;
11411 }
11412 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(filledCircle, "filledCircle");
11413
11414 // src/rendering-util/rendering-elements/shapes/flippedTriangle.ts
11415
11416 async function flippedTriangle(parent, node) {
11417 const { labelStyles, nodeStyles } = styles2String(node);
11418 node.labelStyle = labelStyles;
11419 const { shapeSvg, bbox, label } = await labelHelper(parent, node, getNodeClasses(node));
11420 const w = bbox.width + (node.padding ?? 0);
11421 const h = w + bbox.height;
11422 const tw = w + bbox.height;
11423 const points = [
11424 { x: 0, y: -h },
11425 { x: tw, y: -h },
11426 { x: tw / 2, y: 0 }
11427 ];
11428 const { cssStyles } = node;
11429 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
11430 const options = userNodeOverrides(node, {});
11431 if (node.look !== "handDrawn") {
11432 options.roughness = 0;
11433 options.fillStyle = "solid";
11434 }
11435 const pathData = createPathFromPoints(points);
11436 const roughNode = rc.path(pathData, options);
11437 const flippedTriangle2 = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-h / 2}, ${h / 2})`);
11438 if (cssStyles && node.look !== "handDrawn") {
11439 flippedTriangle2.selectChildren("path").attr("style", cssStyles);
11440 }
11441 if (nodeStyles && node.look !== "handDrawn") {
11442 flippedTriangle2.selectChildren("path").attr("style", nodeStyles);
11443 }
11444 node.width = w;
11445 node.height = h;
11446 updateNodeBounds(node, flippedTriangle2);
11447 label.attr(
11448 "transform",
11449 `translate(${-bbox.width / 2 - (bbox.x - (bbox.left ?? 0))}, ${-h / 2 + (node.padding ?? 0) / 2 + (bbox.y - (bbox.top ?? 0))})`
11450 );
11451 node.intersect = function(point) {
11452 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .cM.info("Triangle intersect", node, points, point);
11453 return intersect_default.polygon(node, points, point);
11454 };
11455 return shapeSvg;
11456 }
11457 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(flippedTriangle, "flippedTriangle");
11458
11459 // src/rendering-util/rendering-elements/shapes/forkJoin.ts
11460
11461 function forkJoin(parent, node, { dir, config: { state: state2, themeVariables } }) {
11462 const { nodeStyles } = styles2String(node);
11463 node.label = "";
11464 const shapeSvg = parent.insert("g").attr("class", getNodeClasses(node)).attr("id", node.domId ?? node.id);
11465 const { cssStyles } = node;
11466 let width = Math.max(70, node?.width ?? 0);
11467 let height = Math.max(10, node?.height ?? 0);
11468 if (dir === "LR") {
11469 width = Math.max(10, node?.width ?? 0);
11470 height = Math.max(70, node?.height ?? 0);
11471 }
11472 const x = -1 * width / 2;
11473 const y = -1 * height / 2;
11474 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
11475 const options = userNodeOverrides(node, {
11476 stroke: themeVariables.lineColor,
11477 fill: themeVariables.lineColor
11478 });
11479 if (node.look !== "handDrawn") {
11480 options.roughness = 0;
11481 options.fillStyle = "solid";
11482 }
11483 const roughNode = rc.rectangle(x, y, width, height, options);
11484 const shape = shapeSvg.insert(() => roughNode, ":first-child");
11485 if (cssStyles && node.look !== "handDrawn") {
11486 shape.selectAll("path").attr("style", cssStyles);
11487 }
11488 if (nodeStyles && node.look !== "handDrawn") {
11489 shape.selectAll("path").attr("style", nodeStyles);
11490 }
11491 updateNodeBounds(node, shape);
11492 const padding = state2?.padding ?? 0;
11493 if (node.width && node.height) {
11494 node.width += padding / 2 || 0;
11495 node.height += padding / 2 || 0;
11496 }
11497 node.intersect = function(point) {
11498 return intersect_default.rect(node, point);
11499 };
11500 return shapeSvg;
11501 }
11502 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(forkJoin, "forkJoin");
11503
11504 // src/rendering-util/rendering-elements/shapes/halfRoundedRectangle.ts
11505
11506 async function halfRoundedRectangle(parent, node) {
11507 const { labelStyles, nodeStyles } = styles2String(node);
11508 node.labelStyle = labelStyles;
11509 const minWidth = 80, minHeight = 50;
11510 const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));
11511 const w = Math.max(minWidth, bbox.width + (node.padding ?? 0) * 2, node?.width ?? 0);
11512 const h = Math.max(minHeight, bbox.height + (node.padding ?? 0) * 2, node?.height ?? 0);
11513 const radius = h / 2;
11514 const { cssStyles } = node;
11515 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
11516 const options = userNodeOverrides(node, {});
11517 if (node.look !== "handDrawn") {
11518 options.roughness = 0;
11519 options.fillStyle = "solid";
11520 }
11521 const points = [
11522 { x: -w / 2, y: -h / 2 },
11523 { x: w / 2 - radius, y: -h / 2 },
11524 ...generateCirclePoints(-w / 2 + radius, 0, radius, 50, 90, 270),
11525 { x: w / 2 - radius, y: h / 2 },
11526 { x: -w / 2, y: h / 2 }
11527 ];
11528 const pathData = createPathFromPoints(points);
11529 const shapeNode = rc.path(pathData, options);
11530 const polygon = shapeSvg.insert(() => shapeNode, ":first-child");
11531 polygon.attr("class", "basic label-container");
11532 if (cssStyles && node.look !== "handDrawn") {
11533 polygon.selectChildren("path").attr("style", cssStyles);
11534 }
11535 if (nodeStyles && node.look !== "handDrawn") {
11536 polygon.selectChildren("path").attr("style", nodeStyles);
11537 }
11538 updateNodeBounds(node, polygon);
11539 node.intersect = function(point) {
11540 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .cM.info("Pill intersect", node, { radius, point });
11541 const pos = intersect_default.polygon(node, points, point);
11542 return pos;
11543 };
11544 return shapeSvg;
11545 }
11546 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(halfRoundedRectangle, "halfRoundedRectangle");
11547
11548 // src/rendering-util/rendering-elements/shapes/hexagon.ts
11549
11550 var createHexagonPathD = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)((x, y, width, height, m) => {
11551 return [
11552 `M${x + m},${y}`,
11553 `L${x + width - m},${y}`,
11554 `L${x + width},${y - height / 2}`,
11555 `L${x + width - m},${y - height}`,
11556 `L${x + m},${y - height}`,
11557 `L${x},${y - height / 2}`,
11558 "Z"
11559 ].join(" ");
11560 }, "createHexagonPathD");
11561 async function hexagon(parent, node) {
11562 const { labelStyles, nodeStyles } = styles2String(node);
11563 node.labelStyle = labelStyles;
11564 const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));
11565 const f = 4;
11566 const h = bbox.height + node.padding;
11567 const m = h / f;
11568 const w = bbox.width + 2 * m + node.padding;
11569 const points = [
11570 { x: m, y: 0 },
11571 { x: w - m, y: 0 },
11572 { x: w, y: -h / 2 },
11573 { x: w - m, y: -h },
11574 { x: m, y: -h },
11575 { x: 0, y: -h / 2 }
11576 ];
11577 let polygon;
11578 const { cssStyles } = node;
11579 if (node.look === "handDrawn") {
11580 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
11581 const options = userNodeOverrides(node, {});
11582 const pathData = createHexagonPathD(0, 0, w, h, m);
11583 const roughNode = rc.path(pathData, options);
11584 polygon = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-w / 2}, ${h / 2})`);
11585 if (cssStyles) {
11586 polygon.attr("style", cssStyles);
11587 }
11588 } else {
11589 polygon = insertPolygonShape(shapeSvg, w, h, points);
11590 }
11591 if (nodeStyles) {
11592 polygon.attr("style", nodeStyles);
11593 }
11594 node.width = w;
11595 node.height = h;
11596 updateNodeBounds(node, polygon);
11597 node.intersect = function(point) {
11598 return intersect_default.polygon(node, points, point);
11599 };
11600 return shapeSvg;
11601 }
11602 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(hexagon, "hexagon");
11603
11604 // src/rendering-util/rendering-elements/shapes/hourglass.ts
11605
11606 async function hourglass(parent, node) {
11607 const { labelStyles, nodeStyles } = styles2String(node);
11608 node.label = "";
11609 node.labelStyle = labelStyles;
11610 const { shapeSvg } = await labelHelper(parent, node, getNodeClasses(node));
11611 const w = Math.max(30, node?.width ?? 0);
11612 const h = Math.max(30, node?.height ?? 0);
11613 const { cssStyles } = node;
11614 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
11615 const options = userNodeOverrides(node, {});
11616 if (node.look !== "handDrawn") {
11617 options.roughness = 0;
11618 options.fillStyle = "solid";
11619 }
11620 const points = [
11621 { x: 0, y: 0 },
11622 { x: w, y: 0 },
11623 { x: 0, y: h },
11624 { x: w, y: h }
11625 ];
11626 const pathData = createPathFromPoints(points);
11627 const shapeNode = rc.path(pathData, options);
11628 const polygon = shapeSvg.insert(() => shapeNode, ":first-child");
11629 polygon.attr("class", "basic label-container");
11630 if (cssStyles && node.look !== "handDrawn") {
11631 polygon.selectChildren("path").attr("style", cssStyles);
11632 }
11633 if (nodeStyles && node.look !== "handDrawn") {
11634 polygon.selectChildren("path").attr("style", nodeStyles);
11635 }
11636 polygon.attr("transform", `translate(${-w / 2}, ${-h / 2})`);
11637 updateNodeBounds(node, polygon);
11638 node.intersect = function(point) {
11639 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .cM.info("Pill intersect", node, { points });
11640 const pos = intersect_default.polygon(node, points, point);
11641 return pos;
11642 };
11643 return shapeSvg;
11644 }
11645 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(hourglass, "hourglass");
11646
11647 // src/rendering-util/rendering-elements/shapes/icon.ts
11648
11649 async function icon(parent, node, { config: { themeVariables, flowchart } }) {
11650 const { labelStyles } = styles2String(node);
11651 node.labelStyle = labelStyles;
11652 const assetHeight = node.assetHeight ?? 48;
11653 const assetWidth = node.assetWidth ?? 48;
11654 const iconSize = Math.max(assetHeight, assetWidth);
11655 const defaultWidth = flowchart?.wrappingWidth;
11656 node.width = Math.max(iconSize, defaultWidth ?? 0);
11657 const { shapeSvg, bbox, label } = await labelHelper(parent, node, "icon-shape default");
11658 const topLabel = node.pos === "t";
11659 const height = iconSize;
11660 const width = iconSize;
11661 const { nodeBorder } = themeVariables;
11662 const { stylesMap } = compileStyles(node);
11663 const x = -width / 2;
11664 const y = -height / 2;
11665 const labelPadding = node.label ? 8 : 0;
11666 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
11667 const options = userNodeOverrides(node, { stroke: "none", fill: "none" });
11668 if (node.look !== "handDrawn") {
11669 options.roughness = 0;
11670 options.fillStyle = "solid";
11671 }
11672 const iconNode = rc.rectangle(x, y, width, height, options);
11673 const outerWidth = Math.max(width, bbox.width);
11674 const outerHeight = height + bbox.height + labelPadding;
11675 const outerNode = rc.rectangle(-outerWidth / 2, -outerHeight / 2, outerWidth, outerHeight, {
11676 ...options,
11677 fill: "transparent",
11678 stroke: "none"
11679 });
11680 const iconShape = shapeSvg.insert(() => iconNode, ":first-child");
11681 const outerShape = shapeSvg.insert(() => outerNode);
11682 if (node.icon) {
11683 const iconElem = shapeSvg.append("g");
11684 iconElem.html(
11685 `<g>${await (0,_chunk_H2D2JQ3I_mjs__WEBPACK_IMPORTED_MODULE_1__/* .getIconSVG */ .s4)(node.icon, {
11686 height: iconSize,
11687 width: iconSize,
11688 fallbackPrefix: ""
11689 })}</g>`
11690 );
11691 const iconBBox = iconElem.node().getBBox();
11692 const iconWidth = iconBBox.width;
11693 const iconHeight = iconBBox.height;
11694 const iconX = iconBBox.x;
11695 const iconY = iconBBox.y;
11696 iconElem.attr(
11697 "transform",
11698 `translate(${-iconWidth / 2 - iconX},${topLabel ? bbox.height / 2 + labelPadding / 2 - iconHeight / 2 - iconY : -bbox.height / 2 - labelPadding / 2 - iconHeight / 2 - iconY})`
11699 );
11700 iconElem.attr("style", `color: ${stylesMap.get("stroke") ?? nodeBorder};`);
11701 }
11702 label.attr(
11703 "transform",
11704 `translate(${-bbox.width / 2 - (bbox.x - (bbox.left ?? 0))},${topLabel ? -outerHeight / 2 : outerHeight / 2 - bbox.height})`
11705 );
11706 iconShape.attr(
11707 "transform",
11708 `translate(${0},${topLabel ? bbox.height / 2 + labelPadding / 2 : -bbox.height / 2 - labelPadding / 2})`
11709 );
11710 updateNodeBounds(node, outerShape);
11711 node.intersect = function(point) {
11712 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .cM.info("iconSquare intersect", node, point);
11713 if (!node.label) {
11714 return intersect_default.rect(node, point);
11715 }
11716 const dx = node.x ?? 0;
11717 const dy = node.y ?? 0;
11718 const nodeHeight = node.height ?? 0;
11719 let points = [];
11720 if (topLabel) {
11721 points = [
11722 { x: dx - bbox.width / 2, y: dy - nodeHeight / 2 },
11723 { x: dx + bbox.width / 2, y: dy - nodeHeight / 2 },
11724 { x: dx + bbox.width / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },
11725 { x: dx + width / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },
11726 { x: dx + width / 2, y: dy + nodeHeight / 2 },
11727 { x: dx - width / 2, y: dy + nodeHeight / 2 },
11728 { x: dx - width / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },
11729 { x: dx - bbox.width / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding }
11730 ];
11731 } else {
11732 points = [
11733 { x: dx - width / 2, y: dy - nodeHeight / 2 },
11734 { x: dx + width / 2, y: dy - nodeHeight / 2 },
11735 { x: dx + width / 2, y: dy - nodeHeight / 2 + height },
11736 { x: dx + bbox.width / 2, y: dy - nodeHeight / 2 + height },
11737 { x: dx + bbox.width / 2 / 2, y: dy + nodeHeight / 2 },
11738 { x: dx - bbox.width / 2, y: dy + nodeHeight / 2 },
11739 { x: dx - bbox.width / 2, y: dy - nodeHeight / 2 + height },
11740 { x: dx - width / 2, y: dy - nodeHeight / 2 + height }
11741 ];
11742 }
11743 const pos = intersect_default.polygon(node, points, point);
11744 return pos;
11745 };
11746 return shapeSvg;
11747 }
11748 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(icon, "icon");
11749
11750 // src/rendering-util/rendering-elements/shapes/iconCircle.ts
11751
11752 async function iconCircle(parent, node, { config: { themeVariables, flowchart } }) {
11753 const { labelStyles } = styles2String(node);
11754 node.labelStyle = labelStyles;
11755 const assetHeight = node.assetHeight ?? 48;
11756 const assetWidth = node.assetWidth ?? 48;
11757 const iconSize = Math.max(assetHeight, assetWidth);
11758 const defaultWidth = flowchart?.wrappingWidth;
11759 node.width = Math.max(iconSize, defaultWidth ?? 0);
11760 const { shapeSvg, bbox, label } = await labelHelper(parent, node, "icon-shape default");
11761 const padding = 20;
11762 const labelPadding = node.label ? 8 : 0;
11763 const topLabel = node.pos === "t";
11764 const { nodeBorder, mainBkg } = themeVariables;
11765 const { stylesMap } = compileStyles(node);
11766 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
11767 const options = userNodeOverrides(node, {});
11768 if (node.look !== "handDrawn") {
11769 options.roughness = 0;
11770 options.fillStyle = "solid";
11771 }
11772 const fill = stylesMap.get("fill");
11773 options.stroke = fill ?? mainBkg;
11774 const iconElem = shapeSvg.append("g");
11775 if (node.icon) {
11776 iconElem.html(
11777 `<g>${await (0,_chunk_H2D2JQ3I_mjs__WEBPACK_IMPORTED_MODULE_1__/* .getIconSVG */ .s4)(node.icon, {
11778 height: iconSize,
11779 width: iconSize,
11780 fallbackPrefix: ""
11781 })}</g>`
11782 );
11783 }
11784 const iconBBox = iconElem.node().getBBox();
11785 const iconWidth = iconBBox.width;
11786 const iconHeight = iconBBox.height;
11787 const iconX = iconBBox.x;
11788 const iconY = iconBBox.y;
11789 const diameter = Math.max(iconWidth, iconHeight) * Math.SQRT2 + padding * 2;
11790 const iconNode = rc.circle(0, 0, diameter, options);
11791 const outerWidth = Math.max(diameter, bbox.width);
11792 const outerHeight = diameter + bbox.height + labelPadding;
11793 const outerNode = rc.rectangle(-outerWidth / 2, -outerHeight / 2, outerWidth, outerHeight, {
11794 ...options,
11795 fill: "transparent",
11796 stroke: "none"
11797 });
11798 const iconShape = shapeSvg.insert(() => iconNode, ":first-child");
11799 const outerShape = shapeSvg.insert(() => outerNode);
11800 iconElem.attr(
11801 "transform",
11802 `translate(${-iconWidth / 2 - iconX},${topLabel ? bbox.height / 2 + labelPadding / 2 - iconHeight / 2 - iconY : -bbox.height / 2 - labelPadding / 2 - iconHeight / 2 - iconY})`
11803 );
11804 iconElem.attr("style", `color: ${stylesMap.get("stroke") ?? nodeBorder};`);
11805 label.attr(
11806 "transform",
11807 `translate(${-bbox.width / 2 - (bbox.x - (bbox.left ?? 0))},${topLabel ? -outerHeight / 2 : outerHeight / 2 - bbox.height})`
11808 );
11809 iconShape.attr(
11810 "transform",
11811 `translate(${0},${topLabel ? bbox.height / 2 + labelPadding / 2 : -bbox.height / 2 - labelPadding / 2})`
11812 );
11813 updateNodeBounds(node, outerShape);
11814 node.intersect = function(point) {
11815 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .cM.info("iconSquare intersect", node, point);
11816 const pos = intersect_default.rect(node, point);
11817 return pos;
11818 };
11819 return shapeSvg;
11820 }
11821 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(iconCircle, "iconCircle");
11822
11823 // src/rendering-util/rendering-elements/shapes/iconRounded.ts
11824
11825 async function iconRounded(parent, node, { config: { themeVariables, flowchart } }) {
11826 const { labelStyles } = styles2String(node);
11827 node.labelStyle = labelStyles;
11828 const assetHeight = node.assetHeight ?? 48;
11829 const assetWidth = node.assetWidth ?? 48;
11830 const iconSize = Math.max(assetHeight, assetWidth);
11831 const defaultWidth = flowchart?.wrappingWidth;
11832 node.width = Math.max(iconSize, defaultWidth ?? 0);
11833 const { shapeSvg, bbox, halfPadding, label } = await labelHelper(
11834 parent,
11835 node,
11836 "icon-shape default"
11837 );
11838 const topLabel = node.pos === "t";
11839 const height = iconSize + halfPadding * 2;
11840 const width = iconSize + halfPadding * 2;
11841 const { nodeBorder, mainBkg } = themeVariables;
11842 const { stylesMap } = compileStyles(node);
11843 const x = -width / 2;
11844 const y = -height / 2;
11845 const labelPadding = node.label ? 8 : 0;
11846 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
11847 const options = userNodeOverrides(node, {});
11848 if (node.look !== "handDrawn") {
11849 options.roughness = 0;
11850 options.fillStyle = "solid";
11851 }
11852 const fill = stylesMap.get("fill");
11853 options.stroke = fill ?? mainBkg;
11854 const iconNode = rc.path(createRoundedRectPathD(x, y, width, height, 5), options);
11855 const outerWidth = Math.max(width, bbox.width);
11856 const outerHeight = height + bbox.height + labelPadding;
11857 const outerNode = rc.rectangle(-outerWidth / 2, -outerHeight / 2, outerWidth, outerHeight, {
11858 ...options,
11859 fill: "transparent",
11860 stroke: "none"
11861 });
11862 const iconShape = shapeSvg.insert(() => iconNode, ":first-child").attr("class", "icon-shape2");
11863 const outerShape = shapeSvg.insert(() => outerNode);
11864 if (node.icon) {
11865 const iconElem = shapeSvg.append("g");
11866 iconElem.html(
11867 `<g>${await (0,_chunk_H2D2JQ3I_mjs__WEBPACK_IMPORTED_MODULE_1__/* .getIconSVG */ .s4)(node.icon, {
11868 height: iconSize,
11869 width: iconSize,
11870 fallbackPrefix: ""
11871 })}</g>`
11872 );
11873 const iconBBox = iconElem.node().getBBox();
11874 const iconWidth = iconBBox.width;
11875 const iconHeight = iconBBox.height;
11876 const iconX = iconBBox.x;
11877 const iconY = iconBBox.y;
11878 iconElem.attr(
11879 "transform",
11880 `translate(${-iconWidth / 2 - iconX},${topLabel ? bbox.height / 2 + labelPadding / 2 - iconHeight / 2 - iconY : -bbox.height / 2 - labelPadding / 2 - iconHeight / 2 - iconY})`
11881 );
11882 iconElem.attr("style", `color: ${stylesMap.get("stroke") ?? nodeBorder};`);
11883 }
11884 label.attr(
11885 "transform",
11886 `translate(${-bbox.width / 2 - (bbox.x - (bbox.left ?? 0))},${topLabel ? -outerHeight / 2 : outerHeight / 2 - bbox.height})`
11887 );
11888 iconShape.attr(
11889 "transform",
11890 `translate(${0},${topLabel ? bbox.height / 2 + labelPadding / 2 : -bbox.height / 2 - labelPadding / 2})`
11891 );
11892 updateNodeBounds(node, outerShape);
11893 node.intersect = function(point) {
11894 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .cM.info("iconSquare intersect", node, point);
11895 if (!node.label) {
11896 return intersect_default.rect(node, point);
11897 }
11898 const dx = node.x ?? 0;
11899 const dy = node.y ?? 0;
11900 const nodeHeight = node.height ?? 0;
11901 let points = [];
11902 if (topLabel) {
11903 points = [
11904 { x: dx - bbox.width / 2, y: dy - nodeHeight / 2 },
11905 { x: dx + bbox.width / 2, y: dy - nodeHeight / 2 },
11906 { x: dx + bbox.width / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },
11907 { x: dx + width / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },
11908 { x: dx + width / 2, y: dy + nodeHeight / 2 },
11909 { x: dx - width / 2, y: dy + nodeHeight / 2 },
11910 { x: dx - width / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },
11911 { x: dx - bbox.width / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding }
11912 ];
11913 } else {
11914 points = [
11915 { x: dx - width / 2, y: dy - nodeHeight / 2 },
11916 { x: dx + width / 2, y: dy - nodeHeight / 2 },
11917 { x: dx + width / 2, y: dy - nodeHeight / 2 + height },
11918 { x: dx + bbox.width / 2, y: dy - nodeHeight / 2 + height },
11919 { x: dx + bbox.width / 2 / 2, y: dy + nodeHeight / 2 },
11920 { x: dx - bbox.width / 2, y: dy + nodeHeight / 2 },
11921 { x: dx - bbox.width / 2, y: dy - nodeHeight / 2 + height },
11922 { x: dx - width / 2, y: dy - nodeHeight / 2 + height }
11923 ];
11924 }
11925 const pos = intersect_default.polygon(node, points, point);
11926 return pos;
11927 };
11928 return shapeSvg;
11929 }
11930 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(iconRounded, "iconRounded");
11931
11932 // src/rendering-util/rendering-elements/shapes/iconSquare.ts
11933
11934 async function iconSquare(parent, node, { config: { themeVariables, flowchart } }) {
11935 const { labelStyles } = styles2String(node);
11936 node.labelStyle = labelStyles;
11937 const assetHeight = node.assetHeight ?? 48;
11938 const assetWidth = node.assetWidth ?? 48;
11939 const iconSize = Math.max(assetHeight, assetWidth);
11940 const defaultWidth = flowchart?.wrappingWidth;
11941 node.width = Math.max(iconSize, defaultWidth ?? 0);
11942 const { shapeSvg, bbox, halfPadding, label } = await labelHelper(
11943 parent,
11944 node,
11945 "icon-shape default"
11946 );
11947 const topLabel = node.pos === "t";
11948 const height = iconSize + halfPadding * 2;
11949 const width = iconSize + halfPadding * 2;
11950 const { nodeBorder, mainBkg } = themeVariables;
11951 const { stylesMap } = compileStyles(node);
11952 const x = -width / 2;
11953 const y = -height / 2;
11954 const labelPadding = node.label ? 8 : 0;
11955 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
11956 const options = userNodeOverrides(node, {});
11957 if (node.look !== "handDrawn") {
11958 options.roughness = 0;
11959 options.fillStyle = "solid";
11960 }
11961 const fill = stylesMap.get("fill");
11962 options.stroke = fill ?? mainBkg;
11963 const iconNode = rc.path(createRoundedRectPathD(x, y, width, height, 0.1), options);
11964 const outerWidth = Math.max(width, bbox.width);
11965 const outerHeight = height + bbox.height + labelPadding;
11966 const outerNode = rc.rectangle(-outerWidth / 2, -outerHeight / 2, outerWidth, outerHeight, {
11967 ...options,
11968 fill: "transparent",
11969 stroke: "none"
11970 });
11971 const iconShape = shapeSvg.insert(() => iconNode, ":first-child");
11972 const outerShape = shapeSvg.insert(() => outerNode);
11973 if (node.icon) {
11974 const iconElem = shapeSvg.append("g");
11975 iconElem.html(
11976 `<g>${await (0,_chunk_H2D2JQ3I_mjs__WEBPACK_IMPORTED_MODULE_1__/* .getIconSVG */ .s4)(node.icon, {
11977 height: iconSize,
11978 width: iconSize,
11979 fallbackPrefix: ""
11980 })}</g>`
11981 );
11982 const iconBBox = iconElem.node().getBBox();
11983 const iconWidth = iconBBox.width;
11984 const iconHeight = iconBBox.height;
11985 const iconX = iconBBox.x;
11986 const iconY = iconBBox.y;
11987 iconElem.attr(
11988 "transform",
11989 `translate(${-iconWidth / 2 - iconX},${topLabel ? bbox.height / 2 + labelPadding / 2 - iconHeight / 2 - iconY : -bbox.height / 2 - labelPadding / 2 - iconHeight / 2 - iconY})`
11990 );
11991 iconElem.attr("style", `color: ${stylesMap.get("stroke") ?? nodeBorder};`);
11992 }
11993 label.attr(
11994 "transform",
11995 `translate(${-bbox.width / 2 - (bbox.x - (bbox.left ?? 0))},${topLabel ? -outerHeight / 2 : outerHeight / 2 - bbox.height})`
11996 );
11997 iconShape.attr(
11998 "transform",
11999 `translate(${0},${topLabel ? bbox.height / 2 + labelPadding / 2 : -bbox.height / 2 - labelPadding / 2})`
12000 );
12001 updateNodeBounds(node, outerShape);
12002 node.intersect = function(point) {
12003 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .cM.info("iconSquare intersect", node, point);
12004 if (!node.label) {
12005 return intersect_default.rect(node, point);
12006 }
12007 const dx = node.x ?? 0;
12008 const dy = node.y ?? 0;
12009 const nodeHeight = node.height ?? 0;
12010 let points = [];
12011 if (topLabel) {
12012 points = [
12013 { x: dx - bbox.width / 2, y: dy - nodeHeight / 2 },
12014 { x: dx + bbox.width / 2, y: dy - nodeHeight / 2 },
12015 { x: dx + bbox.width / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },
12016 { x: dx + width / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },
12017 { x: dx + width / 2, y: dy + nodeHeight / 2 },
12018 { x: dx - width / 2, y: dy + nodeHeight / 2 },
12019 { x: dx - width / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },
12020 { x: dx - bbox.width / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding }
12021 ];
12022 } else {
12023 points = [
12024 { x: dx - width / 2, y: dy - nodeHeight / 2 },
12025 { x: dx + width / 2, y: dy - nodeHeight / 2 },
12026 { x: dx + width / 2, y: dy - nodeHeight / 2 + height },
12027 { x: dx + bbox.width / 2, y: dy - nodeHeight / 2 + height },
12028 { x: dx + bbox.width / 2 / 2, y: dy + nodeHeight / 2 },
12029 { x: dx - bbox.width / 2, y: dy + nodeHeight / 2 },
12030 { x: dx - bbox.width / 2, y: dy - nodeHeight / 2 + height },
12031 { x: dx - width / 2, y: dy - nodeHeight / 2 + height }
12032 ];
12033 }
12034 const pos = intersect_default.polygon(node, points, point);
12035 return pos;
12036 };
12037 return shapeSvg;
12038 }
12039 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(iconSquare, "iconSquare");
12040
12041 // src/rendering-util/rendering-elements/shapes/imageSquare.ts
12042
12043 async function imageSquare(parent, node, { config: { flowchart } }) {
12044 const img = new Image();
12045 img.src = node?.img ?? "";
12046 await img.decode();
12047 const imageNaturalWidth = Number(img.naturalWidth.toString().replace("px", ""));
12048 const imageNaturalHeight = Number(img.naturalHeight.toString().replace("px", ""));
12049 node.imageAspectRatio = imageNaturalWidth / imageNaturalHeight;
12050 const { labelStyles } = styles2String(node);
12051 node.labelStyle = labelStyles;
12052 const defaultWidth = flowchart?.wrappingWidth;
12053 node.defaultWidth = flowchart?.wrappingWidth;
12054 const imageRawWidth = Math.max(
12055 node.label ? defaultWidth ?? 0 : 0,
12056 node?.assetWidth ?? imageNaturalWidth
12057 );
12058 const imageWidth = node.constraint === "on" ? node?.assetHeight ? node.assetHeight * node.imageAspectRatio : imageRawWidth : imageRawWidth;
12059 const imageHeight = node.constraint === "on" ? imageWidth / node.imageAspectRatio : node?.assetHeight ?? imageNaturalHeight;
12060 node.width = Math.max(imageWidth, defaultWidth ?? 0);
12061 const { shapeSvg, bbox, label } = await labelHelper(parent, node, "image-shape default");
12062 const topLabel = node.pos === "t";
12063 const x = -imageWidth / 2;
12064 const y = -imageHeight / 2;
12065 const labelPadding = node.label ? 8 : 0;
12066 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
12067 const options = userNodeOverrides(node, {});
12068 if (node.look !== "handDrawn") {
12069 options.roughness = 0;
12070 options.fillStyle = "solid";
12071 }
12072 const imageNode = rc.rectangle(x, y, imageWidth, imageHeight, options);
12073 const outerWidth = Math.max(imageWidth, bbox.width);
12074 const outerHeight = imageHeight + bbox.height + labelPadding;
12075 const outerNode = rc.rectangle(-outerWidth / 2, -outerHeight / 2, outerWidth, outerHeight, {
12076 ...options,
12077 fill: "none",
12078 stroke: "none"
12079 });
12080 const iconShape = shapeSvg.insert(() => imageNode, ":first-child");
12081 const outerShape = shapeSvg.insert(() => outerNode);
12082 if (node.img) {
12083 const image = shapeSvg.append("image");
12084 image.attr("href", node.img);
12085 image.attr("width", imageWidth);
12086 image.attr("height", imageHeight);
12087 image.attr("preserveAspectRatio", "none");
12088 image.attr(
12089 "transform",
12090 `translate(${-imageWidth / 2},${topLabel ? outerHeight / 2 - imageHeight : -outerHeight / 2})`
12091 );
12092 }
12093 label.attr(
12094 "transform",
12095 `translate(${-bbox.width / 2 - (bbox.x - (bbox.left ?? 0))},${topLabel ? -imageHeight / 2 - bbox.height / 2 - labelPadding / 2 : imageHeight / 2 - bbox.height / 2 + labelPadding / 2})`
12096 );
12097 iconShape.attr(
12098 "transform",
12099 `translate(${0},${topLabel ? bbox.height / 2 + labelPadding / 2 : -bbox.height / 2 - labelPadding / 2})`
12100 );
12101 updateNodeBounds(node, outerShape);
12102 node.intersect = function(point) {
12103 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .cM.info("iconSquare intersect", node, point);
12104 if (!node.label) {
12105 return intersect_default.rect(node, point);
12106 }
12107 const dx = node.x ?? 0;
12108 const dy = node.y ?? 0;
12109 const nodeHeight = node.height ?? 0;
12110 let points = [];
12111 if (topLabel) {
12112 points = [
12113 { x: dx - bbox.width / 2, y: dy - nodeHeight / 2 },
12114 { x: dx + bbox.width / 2, y: dy - nodeHeight / 2 },
12115 { x: dx + bbox.width / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },
12116 { x: dx + imageWidth / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },
12117 { x: dx + imageWidth / 2, y: dy + nodeHeight / 2 },
12118 { x: dx - imageWidth / 2, y: dy + nodeHeight / 2 },
12119 { x: dx - imageWidth / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },
12120 { x: dx - bbox.width / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding }
12121 ];
12122 } else {
12123 points = [
12124 { x: dx - imageWidth / 2, y: dy - nodeHeight / 2 },
12125 { x: dx + imageWidth / 2, y: dy - nodeHeight / 2 },
12126 { x: dx + imageWidth / 2, y: dy - nodeHeight / 2 + imageHeight },
12127 { x: dx + bbox.width / 2, y: dy - nodeHeight / 2 + imageHeight },
12128 { x: dx + bbox.width / 2 / 2, y: dy + nodeHeight / 2 },
12129 { x: dx - bbox.width / 2, y: dy + nodeHeight / 2 },
12130 { x: dx - bbox.width / 2, y: dy - nodeHeight / 2 + imageHeight },
12131 { x: dx - imageWidth / 2, y: dy - nodeHeight / 2 + imageHeight }
12132 ];
12133 }
12134 const pos = intersect_default.polygon(node, points, point);
12135 return pos;
12136 };
12137 return shapeSvg;
12138 }
12139 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(imageSquare, "imageSquare");
12140
12141 // src/rendering-util/rendering-elements/shapes/invertedTrapezoid.ts
12142
12143 async function inv_trapezoid(parent, node) {
12144 const { labelStyles, nodeStyles } = styles2String(node);
12145 node.labelStyle = labelStyles;
12146 const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));
12147 const w = Math.max(bbox.width + (node.padding ?? 0) * 2, node?.width ?? 0);
12148 const h = Math.max(bbox.height + (node.padding ?? 0) * 2, node?.height ?? 0);
12149 const points = [
12150 { x: 0, y: 0 },
12151 { x: w, y: 0 },
12152 { x: w + 3 * h / 6, y: -h },
12153 { x: -3 * h / 6, y: -h }
12154 ];
12155 let polygon;
12156 const { cssStyles } = node;
12157 if (node.look === "handDrawn") {
12158 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
12159 const options = userNodeOverrides(node, {});
12160 const pathData = createPathFromPoints(points);
12161 const roughNode = rc.path(pathData, options);
12162 polygon = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-w / 2}, ${h / 2})`);
12163 if (cssStyles) {
12164 polygon.attr("style", cssStyles);
12165 }
12166 } else {
12167 polygon = insertPolygonShape(shapeSvg, w, h, points);
12168 }
12169 if (nodeStyles) {
12170 polygon.attr("style", nodeStyles);
12171 }
12172 node.width = w;
12173 node.height = h;
12174 updateNodeBounds(node, polygon);
12175 node.intersect = function(point) {
12176 return intersect_default.polygon(node, points, point);
12177 };
12178 return shapeSvg;
12179 }
12180 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(inv_trapezoid, "inv_trapezoid");
12181
12182 // src/rendering-util/rendering-elements/shapes/drawRect.ts
12183
12184 async function drawRect(parent, node, options) {
12185 const { labelStyles, nodeStyles } = styles2String(node);
12186 node.labelStyle = labelStyles;
12187 const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));
12188 const totalWidth = Math.max(bbox.width + options.labelPaddingX * 2, node?.width || 0);
12189 const totalHeight = Math.max(bbox.height + options.labelPaddingY * 2, node?.height || 0);
12190 const x = -totalWidth / 2;
12191 const y = -totalHeight / 2;
12192 let rect2;
12193 let { rx, ry } = node;
12194 const { cssStyles } = node;
12195 if (options?.rx && options.ry) {
12196 rx = options.rx;
12197 ry = options.ry;
12198 }
12199 if (node.look === "handDrawn") {
12200 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
12201 const options2 = userNodeOverrides(node, {});
12202 const roughNode = rx || ry ? rc.path(createRoundedRectPathD(x, y, totalWidth, totalHeight, rx || 0), options2) : rc.rectangle(x, y, totalWidth, totalHeight, options2);
12203 rect2 = shapeSvg.insert(() => roughNode, ":first-child");
12204 rect2.attr("class", "basic label-container").attr("style", (0,_chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .handleUndefinedAttr */ .R7)(cssStyles));
12205 } else {
12206 rect2 = shapeSvg.insert("rect", ":first-child");
12207 rect2.attr("class", "basic label-container").attr("style", nodeStyles).attr("rx", (0,_chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .handleUndefinedAttr */ .R7)(rx)).attr("ry", (0,_chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .handleUndefinedAttr */ .R7)(ry)).attr("x", x).attr("y", y).attr("width", totalWidth).attr("height", totalHeight);
12208 }
12209 updateNodeBounds(node, rect2);
12210 node.intersect = function(point) {
12211 return intersect_default.rect(node, point);
12212 };
12213 return shapeSvg;
12214 }
12215 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(drawRect, "drawRect");
12216
12217 // src/rendering-util/rendering-elements/shapes/labelRect.ts
12218 async function labelRect(parent, node) {
12219 const { shapeSvg, bbox, label } = await labelHelper(parent, node, "label");
12220 const rect2 = shapeSvg.insert("rect", ":first-child");
12221 const totalWidth = 0.1;
12222 const totalHeight = 0.1;
12223 rect2.attr("width", totalWidth).attr("height", totalHeight);
12224 shapeSvg.attr("class", "label edgeLabel");
12225 label.attr(
12226 "transform",
12227 `translate(${-(bbox.width / 2) - (bbox.x - (bbox.left ?? 0))}, ${-(bbox.height / 2) - (bbox.y - (bbox.top ?? 0))})`
12228 );
12229 updateNodeBounds(node, rect2);
12230 node.intersect = function(point) {
12231 return intersect_default.rect(node, point);
12232 };
12233 return shapeSvg;
12234 }
12235 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(labelRect, "labelRect");
12236
12237 // src/rendering-util/rendering-elements/shapes/leanLeft.ts
12238
12239 async function lean_left(parent, node) {
12240 const { labelStyles, nodeStyles } = styles2String(node);
12241 node.labelStyle = labelStyles;
12242 const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));
12243 const w = Math.max(bbox.width + (node.padding ?? 0), node?.width ?? 0);
12244 const h = Math.max(bbox.height + (node.padding ?? 0), node?.height ?? 0);
12245 const points = [
12246 { x: 0, y: 0 },
12247 { x: w + 3 * h / 6, y: 0 },
12248 { x: w, y: -h },
12249 { x: -(3 * h) / 6, y: -h }
12250 ];
12251 let polygon;
12252 const { cssStyles } = node;
12253 if (node.look === "handDrawn") {
12254 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
12255 const options = userNodeOverrides(node, {});
12256 const pathData = createPathFromPoints(points);
12257 const roughNode = rc.path(pathData, options);
12258 polygon = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-w / 2}, ${h / 2})`);
12259 if (cssStyles) {
12260 polygon.attr("style", cssStyles);
12261 }
12262 } else {
12263 polygon = insertPolygonShape(shapeSvg, w, h, points);
12264 }
12265 if (nodeStyles) {
12266 polygon.attr("style", nodeStyles);
12267 }
12268 node.width = w;
12269 node.height = h;
12270 updateNodeBounds(node, polygon);
12271 node.intersect = function(point) {
12272 return intersect_default.polygon(node, points, point);
12273 };
12274 return shapeSvg;
12275 }
12276 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(lean_left, "lean_left");
12277
12278 // src/rendering-util/rendering-elements/shapes/leanRight.ts
12279
12280 async function lean_right(parent, node) {
12281 const { labelStyles, nodeStyles } = styles2String(node);
12282 node.labelStyle = labelStyles;
12283 const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));
12284 const w = Math.max(bbox.width + (node.padding ?? 0), node?.width ?? 0);
12285 const h = Math.max(bbox.height + (node.padding ?? 0), node?.height ?? 0);
12286 const points = [
12287 { x: -3 * h / 6, y: 0 },
12288 { x: w, y: 0 },
12289 { x: w + 3 * h / 6, y: -h },
12290 { x: 0, y: -h }
12291 ];
12292 let polygon;
12293 const { cssStyles } = node;
12294 if (node.look === "handDrawn") {
12295 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
12296 const options = userNodeOverrides(node, {});
12297 const pathData = createPathFromPoints(points);
12298 const roughNode = rc.path(pathData, options);
12299 polygon = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-w / 2}, ${h / 2})`);
12300 if (cssStyles) {
12301 polygon.attr("style", cssStyles);
12302 }
12303 } else {
12304 polygon = insertPolygonShape(shapeSvg, w, h, points);
12305 }
12306 if (nodeStyles) {
12307 polygon.attr("style", nodeStyles);
12308 }
12309 node.width = w;
12310 node.height = h;
12311 updateNodeBounds(node, polygon);
12312 node.intersect = function(point) {
12313 return intersect_default.polygon(node, points, point);
12314 };
12315 return shapeSvg;
12316 }
12317 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(lean_right, "lean_right");
12318
12319 // src/rendering-util/rendering-elements/shapes/lightningBolt.ts
12320
12321 function lightningBolt(parent, node) {
12322 const { labelStyles, nodeStyles } = styles2String(node);
12323 node.label = "";
12324 node.labelStyle = labelStyles;
12325 const shapeSvg = parent.insert("g").attr("class", getNodeClasses(node)).attr("id", node.domId ?? node.id);
12326 const { cssStyles } = node;
12327 const width = Math.max(35, node?.width ?? 0);
12328 const height = Math.max(35, node?.height ?? 0);
12329 const gap = 7;
12330 const points = [
12331 { x: width, y: 0 },
12332 { x: 0, y: height + gap / 2 },
12333 { x: width - 2 * gap, y: height + gap / 2 },
12334 { x: 0, y: 2 * height },
12335 { x: width, y: height - gap / 2 },
12336 { x: 2 * gap, y: height - gap / 2 }
12337 ];
12338 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
12339 const options = userNodeOverrides(node, {});
12340 if (node.look !== "handDrawn") {
12341 options.roughness = 0;
12342 options.fillStyle = "solid";
12343 }
12344 const linePath = createPathFromPoints(points);
12345 const lineNode = rc.path(linePath, options);
12346 const lightningBolt2 = shapeSvg.insert(() => lineNode, ":first-child");
12347 if (cssStyles && node.look !== "handDrawn") {
12348 lightningBolt2.selectAll("path").attr("style", cssStyles);
12349 }
12350 if (nodeStyles && node.look !== "handDrawn") {
12351 lightningBolt2.selectAll("path").attr("style", nodeStyles);
12352 }
12353 lightningBolt2.attr("transform", `translate(-${width / 2},${-height})`);
12354 updateNodeBounds(node, lightningBolt2);
12355 node.intersect = function(point) {
12356 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .cM.info("lightningBolt intersect", node, point);
12357 const pos = intersect_default.polygon(node, points, point);
12358 return pos;
12359 };
12360 return shapeSvg;
12361 }
12362 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(lightningBolt, "lightningBolt");
12363
12364 // src/rendering-util/rendering-elements/shapes/linedCylinder.ts
12365
12366 var createCylinderPathD2 = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)((x, y, width, height, rx, ry, outerOffset) => {
12367 return [
12368 `M${x},${y + ry}`,
12369 `a${rx},${ry} 0,0,0 ${width},0`,
12370 `a${rx},${ry} 0,0,0 ${-width},0`,
12371 `l0,${height}`,
12372 `a${rx},${ry} 0,0,0 ${width},0`,
12373 `l0,${-height}`,
12374 `M${x},${y + ry + outerOffset}`,
12375 `a${rx},${ry} 0,0,0 ${width},0`
12376 ].join(" ");
12377 }, "createCylinderPathD");
12378 var createOuterCylinderPathD2 = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)((x, y, width, height, rx, ry, outerOffset) => {
12379 return [
12380 `M${x},${y + ry}`,
12381 `M${x + width},${y + ry}`,
12382 `a${rx},${ry} 0,0,0 ${-width},0`,
12383 `l0,${height}`,
12384 `a${rx},${ry} 0,0,0 ${width},0`,
12385 `l0,${-height}`,
12386 `M${x},${y + ry + outerOffset}`,
12387 `a${rx},${ry} 0,0,0 ${width},0`
12388 ].join(" ");
12389 }, "createOuterCylinderPathD");
12390 var createInnerCylinderPathD2 = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)((x, y, width, height, rx, ry) => {
12391 return [`M${x - width / 2},${-height / 2}`, `a${rx},${ry} 0,0,0 ${width},0`].join(" ");
12392 }, "createInnerCylinderPathD");
12393 async function linedCylinder(parent, node) {
12394 const { labelStyles, nodeStyles } = styles2String(node);
12395 node.labelStyle = labelStyles;
12396 const { shapeSvg, bbox, label } = await labelHelper(parent, node, getNodeClasses(node));
12397 const w = Math.max(bbox.width + (node.padding ?? 0), node.width ?? 0);
12398 const rx = w / 2;
12399 const ry = rx / (2.5 + w / 50);
12400 const h = Math.max(bbox.height + ry + (node.padding ?? 0), node.height ?? 0);
12401 const outerOffset = h * 0.1;
12402 let cylinder2;
12403 const { cssStyles } = node;
12404 if (node.look === "handDrawn") {
12405 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
12406 const outerPathData = createOuterCylinderPathD2(0, 0, w, h, rx, ry, outerOffset);
12407 const innerPathData = createInnerCylinderPathD2(0, ry, w, h, rx, ry);
12408 const options = userNodeOverrides(node, {});
12409 const outerNode = rc.path(outerPathData, options);
12410 const innerLine = rc.path(innerPathData, options);
12411 const innerLineEl = shapeSvg.insert(() => innerLine, ":first-child");
12412 innerLineEl.attr("class", "line");
12413 cylinder2 = shapeSvg.insert(() => outerNode, ":first-child");
12414 cylinder2.attr("class", "basic label-container");
12415 if (cssStyles) {
12416 cylinder2.attr("style", cssStyles);
12417 }
12418 } else {
12419 const pathData = createCylinderPathD2(0, 0, w, h, rx, ry, outerOffset);
12420 cylinder2 = shapeSvg.insert("path", ":first-child").attr("d", pathData).attr("class", "basic label-container").attr("style", (0,_chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .handleUndefinedAttr */ .R7)(cssStyles)).attr("style", nodeStyles);
12421 }
12422 cylinder2.attr("label-offset-y", ry);
12423 cylinder2.attr("transform", `translate(${-w / 2}, ${-(h / 2 + ry)})`);
12424 updateNodeBounds(node, cylinder2);
12425 label.attr(
12426 "transform",
12427 `translate(${-(bbox.width / 2) - (bbox.x - (bbox.left ?? 0))}, ${-(bbox.height / 2) + ry - (bbox.y - (bbox.top ?? 0))})`
12428 );
12429 node.intersect = function(point) {
12430 const pos = intersect_default.rect(node, point);
12431 const x = pos.x - (node.x ?? 0);
12432 if (rx != 0 && (Math.abs(x) < (node.width ?? 0) / 2 || Math.abs(x) == (node.width ?? 0) / 2 && Math.abs(pos.y - (node.y ?? 0)) > (node.height ?? 0) / 2 - ry)) {
12433 let y = ry * ry * (1 - x * x / (rx * rx));
12434 if (y > 0) {
12435 y = Math.sqrt(y);
12436 }
12437 y = ry - y;
12438 if (point.y - (node.y ?? 0) > 0) {
12439 y = -y;
12440 }
12441 pos.y += y;
12442 }
12443 return pos;
12444 };
12445 return shapeSvg;
12446 }
12447 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(linedCylinder, "linedCylinder");
12448
12449 // src/rendering-util/rendering-elements/shapes/linedWaveEdgedRect.ts
12450
12451 async function linedWaveEdgedRect(parent, node) {
12452 const { labelStyles, nodeStyles } = styles2String(node);
12453 node.labelStyle = labelStyles;
12454 const { shapeSvg, bbox, label } = await labelHelper(parent, node, getNodeClasses(node));
12455 const w = Math.max(bbox.width + (node.padding ?? 0) * 2, node?.width ?? 0);
12456 const h = Math.max(bbox.height + (node.padding ?? 0) * 2, node?.height ?? 0);
12457 const waveAmplitude = h / 4;
12458 const finalH = h + waveAmplitude;
12459 const { cssStyles } = node;
12460 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
12461 const options = userNodeOverrides(node, {});
12462 if (node.look !== "handDrawn") {
12463 options.roughness = 0;
12464 options.fillStyle = "solid";
12465 }
12466 const points = [
12467 { x: -w / 2 - w / 2 * 0.1, y: -finalH / 2 },
12468 { x: -w / 2 - w / 2 * 0.1, y: finalH / 2 },
12469 ...generateFullSineWavePoints(
12470 -w / 2 - w / 2 * 0.1,
12471 finalH / 2,
12472 w / 2 + w / 2 * 0.1,
12473 finalH / 2,
12474 waveAmplitude,
12475 0.8
12476 ),
12477 { x: w / 2 + w / 2 * 0.1, y: -finalH / 2 },
12478 { x: -w / 2 - w / 2 * 0.1, y: -finalH / 2 },
12479 { x: -w / 2, y: -finalH / 2 },
12480 { x: -w / 2, y: finalH / 2 * 1.1 },
12481 { x: -w / 2, y: -finalH / 2 }
12482 ];
12483 const poly = rc.polygon(
12484 points.map((p) => [p.x, p.y]),
12485 options
12486 );
12487 const waveEdgeRect = shapeSvg.insert(() => poly, ":first-child");
12488 waveEdgeRect.attr("class", "basic label-container");
12489 if (cssStyles && node.look !== "handDrawn") {
12490 waveEdgeRect.selectAll("path").attr("style", cssStyles);
12491 }
12492 if (nodeStyles && node.look !== "handDrawn") {
12493 waveEdgeRect.selectAll("path").attr("style", nodeStyles);
12494 }
12495 waveEdgeRect.attr("transform", `translate(0,${-waveAmplitude / 2})`);
12496 label.attr(
12497 "transform",
12498 `translate(${-w / 2 + (node.padding ?? 0) + w / 2 * 0.1 / 2 - (bbox.x - (bbox.left ?? 0))},${-h / 2 + (node.padding ?? 0) - waveAmplitude / 2 - (bbox.y - (bbox.top ?? 0))})`
12499 );
12500 updateNodeBounds(node, waveEdgeRect);
12501 node.intersect = function(point) {
12502 const pos = intersect_default.polygon(node, points, point);
12503 return pos;
12504 };
12505 return shapeSvg;
12506 }
12507 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(linedWaveEdgedRect, "linedWaveEdgedRect");
12508
12509 // src/rendering-util/rendering-elements/shapes/multiRect.ts
12510
12511 async function multiRect(parent, node) {
12512 const { labelStyles, nodeStyles } = styles2String(node);
12513 node.labelStyle = labelStyles;
12514 const { shapeSvg, bbox, label } = await labelHelper(parent, node, getNodeClasses(node));
12515 const w = Math.max(bbox.width + (node.padding ?? 0) * 2, node?.width ?? 0);
12516 const h = Math.max(bbox.height + (node.padding ?? 0) * 2, node?.height ?? 0);
12517 const rectOffset = 5;
12518 const x = -w / 2;
12519 const y = -h / 2;
12520 const { cssStyles } = node;
12521 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
12522 const options = userNodeOverrides(node, {});
12523 const outerPathPoints = [
12524 { x: x - rectOffset, y: y + rectOffset },
12525 { x: x - rectOffset, y: y + h + rectOffset },
12526 { x: x + w - rectOffset, y: y + h + rectOffset },
12527 { x: x + w - rectOffset, y: y + h },
12528 { x: x + w, y: y + h },
12529 { x: x + w, y: y + h - rectOffset },
12530 { x: x + w + rectOffset, y: y + h - rectOffset },
12531 { x: x + w + rectOffset, y: y - rectOffset },
12532 { x: x + rectOffset, y: y - rectOffset },
12533 { x: x + rectOffset, y },
12534 { x, y },
12535 { x, y: y + rectOffset }
12536 ];
12537 const innerPathPoints = [
12538 { x, y: y + rectOffset },
12539 { x: x + w - rectOffset, y: y + rectOffset },
12540 { x: x + w - rectOffset, y: y + h },
12541 { x: x + w, y: y + h },
12542 { x: x + w, y },
12543 { x, y }
12544 ];
12545 if (node.look !== "handDrawn") {
12546 options.roughness = 0;
12547 options.fillStyle = "solid";
12548 }
12549 const outerPath = createPathFromPoints(outerPathPoints);
12550 const outerNode = rc.path(outerPath, options);
12551 const innerPath = createPathFromPoints(innerPathPoints);
12552 const innerNode = rc.path(innerPath, { ...options, fill: "none" });
12553 const multiRect2 = shapeSvg.insert(() => innerNode, ":first-child");
12554 multiRect2.insert(() => outerNode, ":first-child");
12555 multiRect2.attr("class", "basic label-container");
12556 if (cssStyles && node.look !== "handDrawn") {
12557 multiRect2.selectAll("path").attr("style", cssStyles);
12558 }
12559 if (nodeStyles && node.look !== "handDrawn") {
12560 multiRect2.selectAll("path").attr("style", nodeStyles);
12561 }
12562 label.attr(
12563 "transform",
12564 `translate(${-(bbox.width / 2) - rectOffset - (bbox.x - (bbox.left ?? 0))}, ${-(bbox.height / 2) + rectOffset - (bbox.y - (bbox.top ?? 0))})`
12565 );
12566 updateNodeBounds(node, multiRect2);
12567 node.intersect = function(point) {
12568 const pos = intersect_default.polygon(node, outerPathPoints, point);
12569 return pos;
12570 };
12571 return shapeSvg;
12572 }
12573 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(multiRect, "multiRect");
12574
12575 // src/rendering-util/rendering-elements/shapes/multiWaveEdgedRectangle.ts
12576
12577 async function multiWaveEdgedRectangle(parent, node) {
12578 const { labelStyles, nodeStyles } = styles2String(node);
12579 node.labelStyle = labelStyles;
12580 const { shapeSvg, bbox, label } = await labelHelper(parent, node, getNodeClasses(node));
12581 const w = Math.max(bbox.width + (node.padding ?? 0) * 2, node?.width ?? 0);
12582 const h = Math.max(bbox.height + (node.padding ?? 0) * 2, node?.height ?? 0);
12583 const waveAmplitude = h / 4;
12584 const finalH = h + waveAmplitude;
12585 const x = -w / 2;
12586 const y = -finalH / 2;
12587 const rectOffset = 5;
12588 const { cssStyles } = node;
12589 const wavePoints = generateFullSineWavePoints(
12590 x - rectOffset,
12591 y + finalH + rectOffset,
12592 x + w - rectOffset,
12593 y + finalH + rectOffset,
12594 waveAmplitude,
12595 0.8
12596 );
12597 const lastWavePoint = wavePoints?.[wavePoints.length - 1];
12598 const outerPathPoints = [
12599 { x: x - rectOffset, y: y + rectOffset },
12600 { x: x - rectOffset, y: y + finalH + rectOffset },
12601 ...wavePoints,
12602 { x: x + w - rectOffset, y: lastWavePoint.y - rectOffset },
12603 { x: x + w, y: lastWavePoint.y - rectOffset },
12604 { x: x + w, y: lastWavePoint.y - 2 * rectOffset },
12605 { x: x + w + rectOffset, y: lastWavePoint.y - 2 * rectOffset },
12606 { x: x + w + rectOffset, y: y - rectOffset },
12607 { x: x + rectOffset, y: y - rectOffset },
12608 { x: x + rectOffset, y },
12609 { x, y },
12610 { x, y: y + rectOffset }
12611 ];
12612 const innerPathPoints = [
12613 { x, y: y + rectOffset },
12614 { x: x + w - rectOffset, y: y + rectOffset },
12615 { x: x + w - rectOffset, y: lastWavePoint.y - rectOffset },
12616 { x: x + w, y: lastWavePoint.y - rectOffset },
12617 { x: x + w, y },
12618 { x, y }
12619 ];
12620 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
12621 const options = userNodeOverrides(node, {});
12622 if (node.look !== "handDrawn") {
12623 options.roughness = 0;
12624 options.fillStyle = "solid";
12625 }
12626 const outerPath = createPathFromPoints(outerPathPoints);
12627 const outerNode = rc.path(outerPath, options);
12628 const innerPath = createPathFromPoints(innerPathPoints);
12629 const innerNode = rc.path(innerPath, options);
12630 const shape = shapeSvg.insert(() => outerNode, ":first-child");
12631 shape.insert(() => innerNode);
12632 shape.attr("class", "basic label-container");
12633 if (cssStyles && node.look !== "handDrawn") {
12634 shape.selectAll("path").attr("style", cssStyles);
12635 }
12636 if (nodeStyles && node.look !== "handDrawn") {
12637 shape.selectAll("path").attr("style", nodeStyles);
12638 }
12639 shape.attr("transform", `translate(0,${-waveAmplitude / 2})`);
12640 label.attr(
12641 "transform",
12642 `translate(${-(bbox.width / 2) - rectOffset - (bbox.x - (bbox.left ?? 0))}, ${-(bbox.height / 2) + rectOffset - waveAmplitude / 2 - (bbox.y - (bbox.top ?? 0))})`
12643 );
12644 updateNodeBounds(node, shape);
12645 node.intersect = function(point) {
12646 const pos = intersect_default.polygon(node, outerPathPoints, point);
12647 return pos;
12648 };
12649 return shapeSvg;
12650 }
12651 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(multiWaveEdgedRectangle, "multiWaveEdgedRectangle");
12652
12653 // src/rendering-util/rendering-elements/shapes/note.ts
12654
12655 async function note(parent, node, { config: { themeVariables } }) {
12656 const { labelStyles, nodeStyles } = styles2String(node);
12657 node.labelStyle = labelStyles;
12658 const useHtmlLabels = node.useHtmlLabels || (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig */ .iE)().flowchart?.htmlLabels !== false;
12659 if (!useHtmlLabels) {
12660 node.centerLabel = true;
12661 }
12662 const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));
12663 const totalWidth = Math.max(bbox.width + (node.padding ?? 0) * 2, node?.width ?? 0);
12664 const totalHeight = Math.max(bbox.height + (node.padding ?? 0) * 2, node?.height ?? 0);
12665 const x = -totalWidth / 2;
12666 const y = -totalHeight / 2;
12667 const { cssStyles } = node;
12668 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
12669 const options = userNodeOverrides(node, {
12670 fill: themeVariables.noteBkgColor,
12671 stroke: themeVariables.noteBorderColor
12672 });
12673 if (node.look !== "handDrawn") {
12674 options.roughness = 0;
12675 options.fillStyle = "solid";
12676 }
12677 const noteShapeNode = rc.rectangle(x, y, totalWidth, totalHeight, options);
12678 const rect2 = shapeSvg.insert(() => noteShapeNode, ":first-child");
12679 rect2.attr("class", "basic label-container");
12680 if (cssStyles && node.look !== "handDrawn") {
12681 rect2.selectAll("path").attr("style", cssStyles);
12682 }
12683 if (nodeStyles && node.look !== "handDrawn") {
12684 rect2.selectAll("path").attr("style", nodeStyles);
12685 }
12686 updateNodeBounds(node, rect2);
12687 node.intersect = function(point) {
12688 return intersect_default.rect(node, point);
12689 };
12690 return shapeSvg;
12691 }
12692 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(note, "note");
12693
12694 // src/rendering-util/rendering-elements/shapes/question.ts
12695
12696 var createDecisionBoxPathD = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)((x, y, size) => {
12697 return [
12698 `M${x + size / 2},${y}`,
12699 `L${x + size},${y - size / 2}`,
12700 `L${x + size / 2},${y - size}`,
12701 `L${x},${y - size / 2}`,
12702 "Z"
12703 ].join(" ");
12704 }, "createDecisionBoxPathD");
12705 async function question(parent, node) {
12706 const { labelStyles, nodeStyles } = styles2String(node);
12707 node.labelStyle = labelStyles;
12708 const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));
12709 const w = bbox.width + node.padding;
12710 const h = bbox.height + node.padding;
12711 const s = w + h;
12712 const points = [
12713 { x: s / 2, y: 0 },
12714 { x: s, y: -s / 2 },
12715 { x: s / 2, y: -s },
12716 { x: 0, y: -s / 2 }
12717 ];
12718 let polygon;
12719 const { cssStyles } = node;
12720 if (node.look === "handDrawn") {
12721 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
12722 const options = userNodeOverrides(node, {});
12723 const pathData = createDecisionBoxPathD(0, 0, s);
12724 const roughNode = rc.path(pathData, options);
12725 polygon = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-s / 2}, ${s / 2})`);
12726 if (cssStyles) {
12727 polygon.attr("style", cssStyles);
12728 }
12729 } else {
12730 polygon = insertPolygonShape(shapeSvg, s, s, points);
12731 }
12732 if (nodeStyles) {
12733 polygon.attr("style", nodeStyles);
12734 }
12735 updateNodeBounds(node, polygon);
12736 node.intersect = function(point) {
12737 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .cM.debug(
12738 "APA12 Intersect called SPLIT\npoint:",
12739 point,
12740 "\nnode:\n",
12741 node,
12742 "\nres:",
12743 intersect_default.polygon(node, points, point)
12744 );
12745 return intersect_default.polygon(node, points, point);
12746 };
12747 return shapeSvg;
12748 }
12749 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(question, "question");
12750
12751 // src/rendering-util/rendering-elements/shapes/rectLeftInvArrow.ts
12752
12753 async function rect_left_inv_arrow(parent, node) {
12754 const { labelStyles, nodeStyles } = styles2String(node);
12755 node.labelStyle = labelStyles;
12756 const { shapeSvg, bbox, label } = await labelHelper(parent, node, getNodeClasses(node));
12757 const w = Math.max(bbox.width + (node.padding ?? 0), node?.width ?? 0);
12758 const h = Math.max(bbox.height + (node.padding ?? 0), node?.height ?? 0);
12759 const x = -w / 2;
12760 const y = -h / 2;
12761 const notch = y / 2;
12762 const points = [
12763 { x: x + notch, y },
12764 { x, y: 0 },
12765 { x: x + notch, y: -y },
12766 { x: -x, y: -y },
12767 { x: -x, y }
12768 ];
12769 const { cssStyles } = node;
12770 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
12771 const options = userNodeOverrides(node, {});
12772 if (node.look !== "handDrawn") {
12773 options.roughness = 0;
12774 options.fillStyle = "solid";
12775 }
12776 const pathData = createPathFromPoints(points);
12777 const roughNode = rc.path(pathData, options);
12778 const polygon = shapeSvg.insert(() => roughNode, ":first-child");
12779 polygon.attr("class", "basic label-container");
12780 if (cssStyles && node.look !== "handDrawn") {
12781 polygon.selectAll("path").attr("style", cssStyles);
12782 }
12783 if (nodeStyles && node.look !== "handDrawn") {
12784 polygon.selectAll("path").attr("style", nodeStyles);
12785 }
12786 polygon.attr("transform", `translate(${-notch / 2},0)`);
12787 label.attr(
12788 "transform",
12789 `translate(${-notch / 2 - bbox.width / 2 - (bbox.x - (bbox.left ?? 0))}, ${-(bbox.height / 2) - (bbox.y - (bbox.top ?? 0))})`
12790 );
12791 updateNodeBounds(node, polygon);
12792 node.intersect = function(point) {
12793 return intersect_default.polygon(node, points, point);
12794 };
12795 return shapeSvg;
12796 }
12797 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(rect_left_inv_arrow, "rect_left_inv_arrow");
12798
12799 // src/rendering-util/rendering-elements/shapes/rectWithTitle.ts
12800
12801
12802 async function rectWithTitle(parent, node) {
12803 const { labelStyles, nodeStyles } = styles2String(node);
12804 node.labelStyle = labelStyles;
12805 let classes;
12806 if (!node.cssClasses) {
12807 classes = "node default";
12808 } else {
12809 classes = "node " + node.cssClasses;
12810 }
12811 const shapeSvg = parent.insert("g").attr("class", classes).attr("id", node.domId || node.id);
12812 const g = shapeSvg.insert("g");
12813 const label = shapeSvg.insert("g").attr("class", "label").attr("style", nodeStyles);
12814 const description = node.description;
12815 const title = node.label;
12816 const text2 = label.node().appendChild(await createLabel_default(title, node.labelStyle, true, true));
12817 let bbox = { width: 0, height: 0 };
12818 if ((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .evaluate */ .ku)((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .nV)()?.flowchart?.htmlLabels)) {
12819 const div2 = text2.children[0];
12820 const dv2 = (0,d3__WEBPACK_IMPORTED_MODULE_5__/* .select */ .Ys)(text2);
12821 bbox = div2.getBoundingClientRect();
12822 dv2.attr("width", bbox.width);
12823 dv2.attr("height", bbox.height);
12824 }
12825 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .cM.info("Text 2", description);
12826 const textRows = description || [];
12827 const titleBox = text2.getBBox();
12828 const descr = label.node().appendChild(
12829 await createLabel_default(
12830 textRows.join ? textRows.join("<br/>") : textRows,
12831 node.labelStyle,
12832 true,
12833 true
12834 )
12835 );
12836 const div = descr.children[0];
12837 const dv = (0,d3__WEBPACK_IMPORTED_MODULE_5__/* .select */ .Ys)(descr);
12838 bbox = div.getBoundingClientRect();
12839 dv.attr("width", bbox.width);
12840 dv.attr("height", bbox.height);
12841 const halfPadding = (node.padding || 0) / 2;
12842 (0,d3__WEBPACK_IMPORTED_MODULE_5__/* .select */ .Ys)(descr).attr(
12843 "transform",
12844 "translate( " + (bbox.width > titleBox.width ? 0 : (titleBox.width - bbox.width) / 2) + ", " + (titleBox.height + halfPadding + 5) + ")"
12845 );
12846 (0,d3__WEBPACK_IMPORTED_MODULE_5__/* .select */ .Ys)(text2).attr(
12847 "transform",
12848 "translate( " + (bbox.width < titleBox.width ? 0 : -(titleBox.width - bbox.width) / 2) + ", 0)"
12849 );
12850 bbox = label.node().getBBox();
12851 label.attr(
12852 "transform",
12853 "translate(" + -bbox.width / 2 + ", " + (-bbox.height / 2 - halfPadding + 3) + ")"
12854 );
12855 const totalWidth = bbox.width + (node.padding || 0);
12856 const totalHeight = bbox.height + (node.padding || 0);
12857 const x = -bbox.width / 2 - halfPadding;
12858 const y = -bbox.height / 2 - halfPadding;
12859 let rect2;
12860 let innerLine;
12861 if (node.look === "handDrawn") {
12862 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
12863 const options = userNodeOverrides(node, {});
12864 const roughNode = rc.path(
12865 createRoundedRectPathD(x, y, totalWidth, totalHeight, node.rx || 0),
12866 options
12867 );
12868 const roughLine = rc.line(
12869 -bbox.width / 2 - halfPadding,
12870 -bbox.height / 2 - halfPadding + titleBox.height + halfPadding,
12871 bbox.width / 2 + halfPadding,
12872 -bbox.height / 2 - halfPadding + titleBox.height + halfPadding,
12873 options
12874 );
12875 innerLine = shapeSvg.insert(() => {
12876 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .cM.debug("Rough node insert CXC", roughNode);
12877 return roughLine;
12878 }, ":first-child");
12879 rect2 = shapeSvg.insert(() => {
12880 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .cM.debug("Rough node insert CXC", roughNode);
12881 return roughNode;
12882 }, ":first-child");
12883 } else {
12884 rect2 = g.insert("rect", ":first-child");
12885 innerLine = g.insert("line");
12886 rect2.attr("class", "outer title-state").attr("style", nodeStyles).attr("x", -bbox.width / 2 - halfPadding).attr("y", -bbox.height / 2 - halfPadding).attr("width", bbox.width + (node.padding || 0)).attr("height", bbox.height + (node.padding || 0));
12887 innerLine.attr("class", "divider").attr("x1", -bbox.width / 2 - halfPadding).attr("x2", bbox.width / 2 + halfPadding).attr("y1", -bbox.height / 2 - halfPadding + titleBox.height + halfPadding).attr("y2", -bbox.height / 2 - halfPadding + titleBox.height + halfPadding);
12888 }
12889 updateNodeBounds(node, rect2);
12890 node.intersect = function(point) {
12891 return intersect_default.rect(node, point);
12892 };
12893 return shapeSvg;
12894 }
12895 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(rectWithTitle, "rectWithTitle");
12896
12897 // src/rendering-util/rendering-elements/shapes/roundedRect.ts
12898 async function roundedRect(parent, node) {
12899 const options = {
12900 rx: 5,
12901 ry: 5,
12902 classes: "",
12903 labelPaddingX: (node?.padding || 0) * 1,
12904 labelPaddingY: (node?.padding || 0) * 1
12905 };
12906 return drawRect(parent, node, options);
12907 }
12908 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(roundedRect, "roundedRect");
12909
12910 // src/rendering-util/rendering-elements/shapes/shadedProcess.ts
12911
12912 async function shadedProcess(parent, node) {
12913 const { labelStyles, nodeStyles } = styles2String(node);
12914 node.labelStyle = labelStyles;
12915 const { shapeSvg, bbox, label } = await labelHelper(parent, node, getNodeClasses(node));
12916 const halfPadding = node?.padding ?? 0;
12917 const w = Math.max(bbox.width + (node.padding ?? 0) * 2, node?.width ?? 0);
12918 const h = Math.max(bbox.height + (node.padding ?? 0) * 2, node?.height ?? 0);
12919 const x = -bbox.width / 2 - halfPadding;
12920 const y = -bbox.height / 2 - halfPadding;
12921 const { cssStyles } = node;
12922 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
12923 const options = userNodeOverrides(node, {});
12924 if (node.look !== "handDrawn") {
12925 options.roughness = 0;
12926 options.fillStyle = "solid";
12927 }
12928 const points = [
12929 { x, y },
12930 { x: x + w + 8, y },
12931 { x: x + w + 8, y: y + h },
12932 { x: x - 8, y: y + h },
12933 { x: x - 8, y },
12934 { x, y },
12935 { x, y: y + h }
12936 ];
12937 const roughNode = rc.polygon(
12938 points.map((p) => [p.x, p.y]),
12939 options
12940 );
12941 const rect2 = shapeSvg.insert(() => roughNode, ":first-child");
12942 rect2.attr("class", "basic label-container").attr("style", (0,_chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .handleUndefinedAttr */ .R7)(cssStyles));
12943 if (nodeStyles && node.look !== "handDrawn") {
12944 rect2.selectAll("path").attr("style", nodeStyles);
12945 }
12946 if (cssStyles && node.look !== "handDrawn") {
12947 rect2.selectAll("path").attr("style", nodeStyles);
12948 }
12949 label.attr(
12950 "transform",
12951 `translate(${-w / 2 + 4 + (node.padding ?? 0) - (bbox.x - (bbox.left ?? 0))},${-h / 2 + (node.padding ?? 0) - (bbox.y - (bbox.top ?? 0))})`
12952 );
12953 updateNodeBounds(node, rect2);
12954 node.intersect = function(point) {
12955 return intersect_default.rect(node, point);
12956 };
12957 return shapeSvg;
12958 }
12959 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(shadedProcess, "shadedProcess");
12960
12961 // src/rendering-util/rendering-elements/shapes/slopedRect.ts
12962
12963 async function slopedRect(parent, node) {
12964 const { labelStyles, nodeStyles } = styles2String(node);
12965 node.labelStyle = labelStyles;
12966 const { shapeSvg, bbox, label } = await labelHelper(parent, node, getNodeClasses(node));
12967 const w = Math.max(bbox.width + (node.padding ?? 0) * 2, node?.width ?? 0);
12968 const h = Math.max(bbox.height + (node.padding ?? 0) * 2, node?.height ?? 0);
12969 const x = -w / 2;
12970 const y = -h / 2;
12971 const { cssStyles } = node;
12972 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
12973 const options = userNodeOverrides(node, {});
12974 if (node.look !== "handDrawn") {
12975 options.roughness = 0;
12976 options.fillStyle = "solid";
12977 }
12978 const points = [
12979 { x, y },
12980 { x, y: y + h },
12981 { x: x + w, y: y + h },
12982 { x: x + w, y: y - h / 2 }
12983 ];
12984 const pathData = createPathFromPoints(points);
12985 const shapeNode = rc.path(pathData, options);
12986 const polygon = shapeSvg.insert(() => shapeNode, ":first-child");
12987 polygon.attr("class", "basic label-container");
12988 if (cssStyles && node.look !== "handDrawn") {
12989 polygon.selectChildren("path").attr("style", cssStyles);
12990 }
12991 if (nodeStyles && node.look !== "handDrawn") {
12992 polygon.selectChildren("path").attr("style", nodeStyles);
12993 }
12994 polygon.attr("transform", `translate(0, ${h / 4})`);
12995 label.attr(
12996 "transform",
12997 `translate(${-w / 2 + (node.padding ?? 0) - (bbox.x - (bbox.left ?? 0))}, ${-h / 4 + (node.padding ?? 0) - (bbox.y - (bbox.top ?? 0))})`
12998 );
12999 updateNodeBounds(node, polygon);
13000 node.intersect = function(point) {
13001 const pos = intersect_default.polygon(node, points, point);
13002 return pos;
13003 };
13004 return shapeSvg;
13005 }
13006 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(slopedRect, "slopedRect");
13007
13008 // src/rendering-util/rendering-elements/shapes/squareRect.ts
13009 async function squareRect2(parent, node) {
13010 const options = {
13011 rx: 0,
13012 ry: 0,
13013 classes: "",
13014 labelPaddingX: (node?.padding || 0) * 2,
13015 labelPaddingY: (node?.padding || 0) * 1
13016 };
13017 return drawRect(parent, node, options);
13018 }
13019 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(squareRect2, "squareRect");
13020
13021 // src/rendering-util/rendering-elements/shapes/stadium.ts
13022
13023 async function stadium(parent, node) {
13024 const { labelStyles, nodeStyles } = styles2String(node);
13025 node.labelStyle = labelStyles;
13026 const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));
13027 const h = bbox.height + node.padding;
13028 const w = bbox.width + h / 4 + node.padding;
13029 let rect2;
13030 const { cssStyles } = node;
13031 if (node.look === "handDrawn") {
13032 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
13033 const options = userNodeOverrides(node, {});
13034 const pathData = createRoundedRectPathD(-w / 2, -h / 2, w, h, h / 2);
13035 const roughNode = rc.path(pathData, options);
13036 rect2 = shapeSvg.insert(() => roughNode, ":first-child");
13037 rect2.attr("class", "basic label-container").attr("style", (0,_chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .handleUndefinedAttr */ .R7)(cssStyles));
13038 } else {
13039 rect2 = shapeSvg.insert("rect", ":first-child");
13040 rect2.attr("class", "basic label-container").attr("style", nodeStyles).attr("rx", h / 2).attr("ry", h / 2).attr("x", -w / 2).attr("y", -h / 2).attr("width", w).attr("height", h);
13041 }
13042 updateNodeBounds(node, rect2);
13043 node.intersect = function(point) {
13044 return intersect_default.rect(node, point);
13045 };
13046 return shapeSvg;
13047 }
13048 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(stadium, "stadium");
13049
13050 // src/rendering-util/rendering-elements/shapes/state.ts
13051 async function state(parent, node) {
13052 const options = {
13053 rx: 5,
13054 ry: 5,
13055 classes: "flowchart-node"
13056 };
13057 return drawRect(parent, node, options);
13058 }
13059 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(state, "state");
13060
13061 // src/rendering-util/rendering-elements/shapes/stateEnd.ts
13062
13063 function stateEnd(parent, node, { config: { themeVariables } }) {
13064 const { labelStyles, nodeStyles } = styles2String(node);
13065 node.labelStyle = labelStyles;
13066 const { cssStyles } = node;
13067 const { lineColor, stateBorder, nodeBorder } = themeVariables;
13068 const shapeSvg = parent.insert("g").attr("class", "node default").attr("id", node.domId || node.id);
13069 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
13070 const options = userNodeOverrides(node, {});
13071 if (node.look !== "handDrawn") {
13072 options.roughness = 0;
13073 options.fillStyle = "solid";
13074 }
13075 const roughNode = rc.circle(0, 0, 14, {
13076 ...options,
13077 stroke: lineColor,
13078 strokeWidth: 2
13079 });
13080 const innerFill = stateBorder ?? nodeBorder;
13081 const roughInnerNode = rc.circle(0, 0, 5, {
13082 ...options,
13083 fill: innerFill,
13084 stroke: innerFill,
13085 strokeWidth: 2,
13086 fillStyle: "solid"
13087 });
13088 const circle2 = shapeSvg.insert(() => roughNode, ":first-child");
13089 circle2.insert(() => roughInnerNode);
13090 if (cssStyles) {
13091 circle2.selectAll("path").attr("style", cssStyles);
13092 }
13093 if (nodeStyles) {
13094 circle2.selectAll("path").attr("style", nodeStyles);
13095 }
13096 updateNodeBounds(node, circle2);
13097 node.intersect = function(point) {
13098 return intersect_default.circle(node, 7, point);
13099 };
13100 return shapeSvg;
13101 }
13102 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(stateEnd, "stateEnd");
13103
13104 // src/rendering-util/rendering-elements/shapes/stateStart.ts
13105
13106 function stateStart(parent, node, { config: { themeVariables } }) {
13107 const { lineColor } = themeVariables;
13108 const shapeSvg = parent.insert("g").attr("class", "node default").attr("id", node.domId || node.id);
13109 let circle2;
13110 if (node.look === "handDrawn") {
13111 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
13112 const roughNode = rc.circle(0, 0, 14, solidStateFill(lineColor));
13113 circle2 = shapeSvg.insert(() => roughNode);
13114 circle2.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14);
13115 } else {
13116 circle2 = shapeSvg.insert("circle", ":first-child");
13117 circle2.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14);
13118 }
13119 updateNodeBounds(node, circle2);
13120 node.intersect = function(point) {
13121 return intersect_default.circle(node, 7, point);
13122 };
13123 return shapeSvg;
13124 }
13125 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(stateStart, "stateStart");
13126
13127 // src/rendering-util/rendering-elements/shapes/subroutine.ts
13128
13129 async function subroutine(parent, node) {
13130 const { labelStyles, nodeStyles } = styles2String(node);
13131 node.labelStyle = labelStyles;
13132 const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));
13133 const halfPadding = (node?.padding || 0) / 2;
13134 const w = bbox.width + node.padding;
13135 const h = bbox.height + node.padding;
13136 const x = -bbox.width / 2 - halfPadding;
13137 const y = -bbox.height / 2 - halfPadding;
13138 const points = [
13139 { x: 0, y: 0 },
13140 { x: w, y: 0 },
13141 { x: w, y: -h },
13142 { x: 0, y: -h },
13143 { x: 0, y: 0 },
13144 { x: -8, y: 0 },
13145 { x: w + 8, y: 0 },
13146 { x: w + 8, y: -h },
13147 { x: -8, y: -h },
13148 { x: -8, y: 0 }
13149 ];
13150 if (node.look === "handDrawn") {
13151 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
13152 const options = userNodeOverrides(node, {});
13153 const roughNode = rc.rectangle(x - 8, y, w + 16, h, options);
13154 const l1 = rc.line(x, y, x, y + h, options);
13155 const l2 = rc.line(x + w, y, x + w, y + h, options);
13156 shapeSvg.insert(() => l1, ":first-child");
13157 shapeSvg.insert(() => l2, ":first-child");
13158 const rect2 = shapeSvg.insert(() => roughNode, ":first-child");
13159 const { cssStyles } = node;
13160 rect2.attr("class", "basic label-container").attr("style", (0,_chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .handleUndefinedAttr */ .R7)(cssStyles));
13161 updateNodeBounds(node, rect2);
13162 } else {
13163 const el = insertPolygonShape(shapeSvg, w, h, points);
13164 if (nodeStyles) {
13165 el.attr("style", nodeStyles);
13166 }
13167 updateNodeBounds(node, el);
13168 }
13169 node.intersect = function(point) {
13170 return intersect_default.polygon(node, points, point);
13171 };
13172 return shapeSvg;
13173 }
13174 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(subroutine, "subroutine");
13175
13176 // src/rendering-util/rendering-elements/shapes/taggedRect.ts
13177
13178 async function taggedRect(parent, node) {
13179 const { labelStyles, nodeStyles } = styles2String(node);
13180 node.labelStyle = labelStyles;
13181 const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));
13182 const w = Math.max(bbox.width + (node.padding ?? 0) * 2, node?.width ?? 0);
13183 const h = Math.max(bbox.height + (node.padding ?? 0) * 2, node?.height ?? 0);
13184 const x = -w / 2;
13185 const y = -h / 2;
13186 const tagWidth = 0.2 * h;
13187 const tagHeight = 0.2 * h;
13188 const { cssStyles } = node;
13189 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
13190 const options = userNodeOverrides(node, {});
13191 const rectPoints = [
13192 { x: x - tagWidth / 2, y },
13193 { x: x + w + tagWidth / 2, y },
13194 { x: x + w + tagWidth / 2, y: y + h },
13195 { x: x - tagWidth / 2, y: y + h }
13196 ];
13197 const tagPoints = [
13198 { x: x + w - tagWidth / 2, y: y + h },
13199 { x: x + w + tagWidth / 2, y: y + h },
13200 { x: x + w + tagWidth / 2, y: y + h - tagHeight }
13201 ];
13202 if (node.look !== "handDrawn") {
13203 options.roughness = 0;
13204 options.fillStyle = "solid";
13205 }
13206 const rectPath = createPathFromPoints(rectPoints);
13207 const rectNode = rc.path(rectPath, options);
13208 const tagPath = createPathFromPoints(tagPoints);
13209 const tagNode = rc.path(tagPath, { ...options, fillStyle: "solid" });
13210 const taggedRect2 = shapeSvg.insert(() => tagNode, ":first-child");
13211 taggedRect2.insert(() => rectNode, ":first-child");
13212 taggedRect2.attr("class", "basic label-container");
13213 if (cssStyles && node.look !== "handDrawn") {
13214 taggedRect2.selectAll("path").attr("style", cssStyles);
13215 }
13216 if (nodeStyles && node.look !== "handDrawn") {
13217 taggedRect2.selectAll("path").attr("style", nodeStyles);
13218 }
13219 updateNodeBounds(node, taggedRect2);
13220 node.intersect = function(point) {
13221 const pos = intersect_default.polygon(node, rectPoints, point);
13222 return pos;
13223 };
13224 return shapeSvg;
13225 }
13226 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(taggedRect, "taggedRect");
13227
13228 // src/rendering-util/rendering-elements/shapes/taggedWaveEdgedRectangle.ts
13229
13230 async function taggedWaveEdgedRectangle(parent, node) {
13231 const { labelStyles, nodeStyles } = styles2String(node);
13232 node.labelStyle = labelStyles;
13233 const { shapeSvg, bbox, label } = await labelHelper(parent, node, getNodeClasses(node));
13234 const w = Math.max(bbox.width + (node.padding ?? 0) * 2, node?.width ?? 0);
13235 const h = Math.max(bbox.height + (node.padding ?? 0) * 2, node?.height ?? 0);
13236 const waveAmplitude = h / 4;
13237 const tagWidth = 0.2 * w;
13238 const tagHeight = 0.2 * h;
13239 const finalH = h + waveAmplitude;
13240 const { cssStyles } = node;
13241 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
13242 const options = userNodeOverrides(node, {});
13243 if (node.look !== "handDrawn") {
13244 options.roughness = 0;
13245 options.fillStyle = "solid";
13246 }
13247 const points = [
13248 { x: -w / 2 - w / 2 * 0.1, y: finalH / 2 },
13249 ...generateFullSineWavePoints(
13250 -w / 2 - w / 2 * 0.1,
13251 finalH / 2,
13252 w / 2 + w / 2 * 0.1,
13253 finalH / 2,
13254 waveAmplitude,
13255 0.8
13256 ),
13257 { x: w / 2 + w / 2 * 0.1, y: -finalH / 2 },
13258 { x: -w / 2 - w / 2 * 0.1, y: -finalH / 2 }
13259 ];
13260 const x = -w / 2 + w / 2 * 0.1;
13261 const y = -finalH / 2 - tagHeight * 0.4;
13262 const tagPoints = [
13263 { x: x + w - tagWidth, y: (y + h) * 1.4 },
13264 { x: x + w, y: y + h - tagHeight },
13265 { x: x + w, y: (y + h) * 0.9 },
13266 ...generateFullSineWavePoints(
13267 x + w,
13268 (y + h) * 1.3,
13269 x + w - tagWidth,
13270 (y + h) * 1.5,
13271 -h * 0.03,
13272 0.5
13273 )
13274 ];
13275 const waveEdgeRectPath = createPathFromPoints(points);
13276 const waveEdgeRectNode = rc.path(waveEdgeRectPath, options);
13277 const taggedWaveEdgeRectPath = createPathFromPoints(tagPoints);
13278 const taggedWaveEdgeRectNode = rc.path(taggedWaveEdgeRectPath, {
13279 ...options,
13280 fillStyle: "solid"
13281 });
13282 const waveEdgeRect = shapeSvg.insert(() => taggedWaveEdgeRectNode, ":first-child");
13283 waveEdgeRect.insert(() => waveEdgeRectNode, ":first-child");
13284 waveEdgeRect.attr("class", "basic label-container");
13285 if (cssStyles && node.look !== "handDrawn") {
13286 waveEdgeRect.selectAll("path").attr("style", cssStyles);
13287 }
13288 if (nodeStyles && node.look !== "handDrawn") {
13289 waveEdgeRect.selectAll("path").attr("style", nodeStyles);
13290 }
13291 waveEdgeRect.attr("transform", `translate(0,${-waveAmplitude / 2})`);
13292 label.attr(
13293 "transform",
13294 `translate(${-w / 2 + (node.padding ?? 0) - (bbox.x - (bbox.left ?? 0))},${-h / 2 + (node.padding ?? 0) - waveAmplitude / 2 - (bbox.y - (bbox.top ?? 0))})`
13295 );
13296 updateNodeBounds(node, waveEdgeRect);
13297 node.intersect = function(point) {
13298 const pos = intersect_default.polygon(node, points, point);
13299 return pos;
13300 };
13301 return shapeSvg;
13302 }
13303 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(taggedWaveEdgedRectangle, "taggedWaveEdgedRectangle");
13304
13305 // src/rendering-util/rendering-elements/shapes/text.ts
13306 async function text(parent, node) {
13307 const { labelStyles, nodeStyles } = styles2String(node);
13308 node.labelStyle = labelStyles;
13309 const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));
13310 const totalWidth = Math.max(bbox.width + node.padding, node?.width || 0);
13311 const totalHeight = Math.max(bbox.height + node.padding, node?.height || 0);
13312 const x = -totalWidth / 2;
13313 const y = -totalHeight / 2;
13314 const rect2 = shapeSvg.insert("rect", ":first-child");
13315 rect2.attr("class", "text").attr("style", nodeStyles).attr("rx", 0).attr("ry", 0).attr("x", x).attr("y", y).attr("width", totalWidth).attr("height", totalHeight);
13316 updateNodeBounds(node, rect2);
13317 node.intersect = function(point) {
13318 return intersect_default.rect(node, point);
13319 };
13320 return shapeSvg;
13321 }
13322 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(text, "text");
13323
13324 // src/rendering-util/rendering-elements/shapes/tiltedCylinder.ts
13325
13326 var createCylinderPathD3 = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)((x, y, width, height, rx, ry) => {
13327 return `M${x},${y}
13328 a${rx},${ry} 0,0,1 ${0},${-height}
13329 l${width},${0}
13330 a${rx},${ry} 0,0,1 ${0},${height}
13331 M${width},${-height}
13332 a${rx},${ry} 0,0,0 ${0},${height}
13333 l${-width},${0}`;
13334 }, "createCylinderPathD");
13335 var createOuterCylinderPathD3 = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)((x, y, width, height, rx, ry) => {
13336 return [
13337 `M${x},${y}`,
13338 `M${x + width},${y}`,
13339 `a${rx},${ry} 0,0,0 ${0},${-height}`,
13340 `l${-width},0`,
13341 `a${rx},${ry} 0,0,0 ${0},${height}`,
13342 `l${width},0`
13343 ].join(" ");
13344 }, "createOuterCylinderPathD");
13345 var createInnerCylinderPathD3 = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)((x, y, width, height, rx, ry) => {
13346 return [`M${x + width / 2},${-height / 2}`, `a${rx},${ry} 0,0,0 0,${height}`].join(" ");
13347 }, "createInnerCylinderPathD");
13348 async function tiltedCylinder(parent, node) {
13349 const { labelStyles, nodeStyles } = styles2String(node);
13350 node.labelStyle = labelStyles;
13351 const { shapeSvg, bbox, label, halfPadding } = await labelHelper(
13352 parent,
13353 node,
13354 getNodeClasses(node)
13355 );
13356 const labelPadding = node.look === "neo" ? halfPadding * 2 : halfPadding;
13357 const h = bbox.height + labelPadding;
13358 const ry = h / 2;
13359 const rx = ry / (2.5 + h / 50);
13360 const w = bbox.width + rx + labelPadding;
13361 const { cssStyles } = node;
13362 let cylinder2;
13363 if (node.look === "handDrawn") {
13364 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
13365 const outerPathData = createOuterCylinderPathD3(0, 0, w, h, rx, ry);
13366 const innerPathData = createInnerCylinderPathD3(0, 0, w, h, rx, ry);
13367 const outerNode = rc.path(outerPathData, userNodeOverrides(node, {}));
13368 const innerLine = rc.path(innerPathData, userNodeOverrides(node, { fill: "none" }));
13369 cylinder2 = shapeSvg.insert(() => innerLine, ":first-child");
13370 cylinder2 = shapeSvg.insert(() => outerNode, ":first-child");
13371 cylinder2.attr("class", "basic label-container");
13372 if (cssStyles) {
13373 cylinder2.attr("style", cssStyles);
13374 }
13375 } else {
13376 const pathData = createCylinderPathD3(0, 0, w, h, rx, ry);
13377 cylinder2 = shapeSvg.insert("path", ":first-child").attr("d", pathData).attr("class", "basic label-container").attr("style", (0,_chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .handleUndefinedAttr */ .R7)(cssStyles)).attr("style", nodeStyles);
13378 cylinder2.attr("class", "basic label-container");
13379 if (cssStyles) {
13380 cylinder2.selectAll("path").attr("style", cssStyles);
13381 }
13382 if (nodeStyles) {
13383 cylinder2.selectAll("path").attr("style", nodeStyles);
13384 }
13385 }
13386 cylinder2.attr("label-offset-x", rx);
13387 cylinder2.attr("transform", `translate(${-w / 2}, ${h / 2} )`);
13388 label.attr(
13389 "transform",
13390 `translate(${-(bbox.width / 2) - rx - (bbox.x - (bbox.left ?? 0))}, ${-(bbox.height / 2) - (bbox.y - (bbox.top ?? 0))})`
13391 );
13392 updateNodeBounds(node, cylinder2);
13393 node.intersect = function(point) {
13394 const pos = intersect_default.rect(node, point);
13395 const y = pos.y - (node.y ?? 0);
13396 if (ry != 0 && (Math.abs(y) < (node.height ?? 0) / 2 || Math.abs(y) == (node.height ?? 0) / 2 && Math.abs(pos.x - (node.x ?? 0)) > (node.width ?? 0) / 2 - rx)) {
13397 let x = rx * rx * (1 - y * y / (ry * ry));
13398 if (x != 0) {
13399 x = Math.sqrt(Math.abs(x));
13400 }
13401 x = rx - x;
13402 if (point.x - (node.x ?? 0) > 0) {
13403 x = -x;
13404 }
13405 pos.x += x;
13406 }
13407 return pos;
13408 };
13409 return shapeSvg;
13410 }
13411 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(tiltedCylinder, "tiltedCylinder");
13412
13413 // src/rendering-util/rendering-elements/shapes/trapezoid.ts
13414
13415 async function trapezoid(parent, node) {
13416 const { labelStyles, nodeStyles } = styles2String(node);
13417 node.labelStyle = labelStyles;
13418 const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));
13419 const w = bbox.width + node.padding;
13420 const h = bbox.height + node.padding;
13421 const points = [
13422 { x: -3 * h / 6, y: 0 },
13423 { x: w + 3 * h / 6, y: 0 },
13424 { x: w, y: -h },
13425 { x: 0, y: -h }
13426 ];
13427 let polygon;
13428 const { cssStyles } = node;
13429 if (node.look === "handDrawn") {
13430 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
13431 const options = userNodeOverrides(node, {});
13432 const pathData = createPathFromPoints(points);
13433 const roughNode = rc.path(pathData, options);
13434 polygon = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-w / 2}, ${h / 2})`);
13435 if (cssStyles) {
13436 polygon.attr("style", cssStyles);
13437 }
13438 } else {
13439 polygon = insertPolygonShape(shapeSvg, w, h, points);
13440 }
13441 if (nodeStyles) {
13442 polygon.attr("style", nodeStyles);
13443 }
13444 node.width = w;
13445 node.height = h;
13446 updateNodeBounds(node, polygon);
13447 node.intersect = function(point) {
13448 return intersect_default.polygon(node, points, point);
13449 };
13450 return shapeSvg;
13451 }
13452 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(trapezoid, "trapezoid");
13453
13454 // src/rendering-util/rendering-elements/shapes/trapezoidalPentagon.ts
13455
13456 async function trapezoidalPentagon(parent, node) {
13457 const { labelStyles, nodeStyles } = styles2String(node);
13458 node.labelStyle = labelStyles;
13459 const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));
13460 const minWidth = 60, minHeight = 20;
13461 const w = Math.max(minWidth, bbox.width + (node.padding ?? 0) * 2, node?.width ?? 0);
13462 const h = Math.max(minHeight, bbox.height + (node.padding ?? 0) * 2, node?.height ?? 0);
13463 const { cssStyles } = node;
13464 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
13465 const options = userNodeOverrides(node, {});
13466 if (node.look !== "handDrawn") {
13467 options.roughness = 0;
13468 options.fillStyle = "solid";
13469 }
13470 const points = [
13471 { x: -w / 2 * 0.8, y: -h / 2 },
13472 { x: w / 2 * 0.8, y: -h / 2 },
13473 { x: w / 2, y: -h / 2 * 0.6 },
13474 { x: w / 2, y: h / 2 },
13475 { x: -w / 2, y: h / 2 },
13476 { x: -w / 2, y: -h / 2 * 0.6 }
13477 ];
13478 const pathData = createPathFromPoints(points);
13479 const shapeNode = rc.path(pathData, options);
13480 const polygon = shapeSvg.insert(() => shapeNode, ":first-child");
13481 polygon.attr("class", "basic label-container");
13482 if (cssStyles && node.look !== "handDrawn") {
13483 polygon.selectChildren("path").attr("style", cssStyles);
13484 }
13485 if (nodeStyles && node.look !== "handDrawn") {
13486 polygon.selectChildren("path").attr("style", nodeStyles);
13487 }
13488 updateNodeBounds(node, polygon);
13489 node.intersect = function(point) {
13490 const pos = intersect_default.polygon(node, points, point);
13491 return pos;
13492 };
13493 return shapeSvg;
13494 }
13495 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(trapezoidalPentagon, "trapezoidalPentagon");
13496
13497 // src/rendering-util/rendering-elements/shapes/triangle.ts
13498
13499 async function triangle(parent, node) {
13500 const { labelStyles, nodeStyles } = styles2String(node);
13501 node.labelStyle = labelStyles;
13502 const { shapeSvg, bbox, label } = await labelHelper(parent, node, getNodeClasses(node));
13503 const useHtmlLabels = (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .evaluate */ .ku)((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .nV)().flowchart?.htmlLabels);
13504 const w = bbox.width + (node.padding ?? 0);
13505 const h = w + bbox.height;
13506 const tw = w + bbox.height;
13507 const points = [
13508 { x: 0, y: 0 },
13509 { x: tw, y: 0 },
13510 { x: tw / 2, y: -h }
13511 ];
13512 const { cssStyles } = node;
13513 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
13514 const options = userNodeOverrides(node, {});
13515 if (node.look !== "handDrawn") {
13516 options.roughness = 0;
13517 options.fillStyle = "solid";
13518 }
13519 const pathData = createPathFromPoints(points);
13520 const roughNode = rc.path(pathData, options);
13521 const polygon = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-h / 2}, ${h / 2})`);
13522 if (cssStyles && node.look !== "handDrawn") {
13523 polygon.selectChildren("path").attr("style", cssStyles);
13524 }
13525 if (nodeStyles && node.look !== "handDrawn") {
13526 polygon.selectChildren("path").attr("style", nodeStyles);
13527 }
13528 node.width = w;
13529 node.height = h;
13530 updateNodeBounds(node, polygon);
13531 label.attr(
13532 "transform",
13533 `translate(${-bbox.width / 2 - (bbox.x - (bbox.left ?? 0))}, ${h / 2 - (bbox.height + (node.padding ?? 0) / (useHtmlLabels ? 2 : 1) - (bbox.y - (bbox.top ?? 0)))})`
13534 );
13535 node.intersect = function(point) {
13536 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .cM.info("Triangle intersect", node, points, point);
13537 return intersect_default.polygon(node, points, point);
13538 };
13539 return shapeSvg;
13540 }
13541 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(triangle, "triangle");
13542
13543 // src/rendering-util/rendering-elements/shapes/waveEdgedRectangle.ts
13544
13545 async function waveEdgedRectangle(parent, node) {
13546 const { labelStyles, nodeStyles } = styles2String(node);
13547 node.labelStyle = labelStyles;
13548 const { shapeSvg, bbox, label } = await labelHelper(parent, node, getNodeClasses(node));
13549 const w = Math.max(bbox.width + (node.padding ?? 0) * 2, node?.width ?? 0);
13550 const h = Math.max(bbox.height + (node.padding ?? 0) * 2, node?.height ?? 0);
13551 const waveAmplitude = h / 8;
13552 const finalH = h + waveAmplitude;
13553 const { cssStyles } = node;
13554 const minWidth = 70;
13555 const widthDif = minWidth - w;
13556 const extraW = widthDif > 0 ? widthDif / 2 : 0;
13557 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
13558 const options = userNodeOverrides(node, {});
13559 if (node.look !== "handDrawn") {
13560 options.roughness = 0;
13561 options.fillStyle = "solid";
13562 }
13563 const points = [
13564 { x: -w / 2 - extraW, y: finalH / 2 },
13565 ...generateFullSineWavePoints(
13566 -w / 2 - extraW,
13567 finalH / 2,
13568 w / 2 + extraW,
13569 finalH / 2,
13570 waveAmplitude,
13571 0.8
13572 ),
13573 { x: w / 2 + extraW, y: -finalH / 2 },
13574 { x: -w / 2 - extraW, y: -finalH / 2 }
13575 ];
13576 const waveEdgeRectPath = createPathFromPoints(points);
13577 const waveEdgeRectNode = rc.path(waveEdgeRectPath, options);
13578 const waveEdgeRect = shapeSvg.insert(() => waveEdgeRectNode, ":first-child");
13579 waveEdgeRect.attr("class", "basic label-container");
13580 if (cssStyles && node.look !== "handDrawn") {
13581 waveEdgeRect.selectAll("path").attr("style", cssStyles);
13582 }
13583 if (nodeStyles && node.look !== "handDrawn") {
13584 waveEdgeRect.selectAll("path").attr("style", nodeStyles);
13585 }
13586 waveEdgeRect.attr("transform", `translate(0,${-waveAmplitude / 2})`);
13587 label.attr(
13588 "transform",
13589 `translate(${-w / 2 + (node.padding ?? 0) - (bbox.x - (bbox.left ?? 0))},${-h / 2 + (node.padding ?? 0) - waveAmplitude - (bbox.y - (bbox.top ?? 0))})`
13590 );
13591 updateNodeBounds(node, waveEdgeRect);
13592 node.intersect = function(point) {
13593 const pos = intersect_default.polygon(node, points, point);
13594 return pos;
13595 };
13596 return shapeSvg;
13597 }
13598 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(waveEdgedRectangle, "waveEdgedRectangle");
13599
13600 // src/rendering-util/rendering-elements/shapes/waveRectangle.ts
13601
13602 async function waveRectangle(parent, node) {
13603 const { labelStyles, nodeStyles } = styles2String(node);
13604 node.labelStyle = labelStyles;
13605 const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));
13606 const minWidth = 100;
13607 const minHeight = 50;
13608 const baseWidth = Math.max(bbox.width + (node.padding ?? 0) * 2, node?.width ?? 0);
13609 const baseHeight = Math.max(bbox.height + (node.padding ?? 0) * 2, node?.height ?? 0);
13610 const aspectRatio = baseWidth / baseHeight;
13611 let w = baseWidth;
13612 let h = baseHeight;
13613 if (w > h * aspectRatio) {
13614 h = w / aspectRatio;
13615 } else {
13616 w = h * aspectRatio;
13617 }
13618 w = Math.max(w, minWidth);
13619 h = Math.max(h, minHeight);
13620 const waveAmplitude = Math.min(h * 0.2, h / 4);
13621 const finalH = h + waveAmplitude * 2;
13622 const { cssStyles } = node;
13623 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
13624 const options = userNodeOverrides(node, {});
13625 if (node.look !== "handDrawn") {
13626 options.roughness = 0;
13627 options.fillStyle = "solid";
13628 }
13629 const points = [
13630 { x: -w / 2, y: finalH / 2 },
13631 ...generateFullSineWavePoints(-w / 2, finalH / 2, w / 2, finalH / 2, waveAmplitude, 1),
13632 { x: w / 2, y: -finalH / 2 },
13633 ...generateFullSineWavePoints(w / 2, -finalH / 2, -w / 2, -finalH / 2, waveAmplitude, -1)
13634 ];
13635 const waveRectPath = createPathFromPoints(points);
13636 const waveRectNode = rc.path(waveRectPath, options);
13637 const waveRect = shapeSvg.insert(() => waveRectNode, ":first-child");
13638 waveRect.attr("class", "basic label-container");
13639 if (cssStyles && node.look !== "handDrawn") {
13640 waveRect.selectAll("path").attr("style", cssStyles);
13641 }
13642 if (nodeStyles && node.look !== "handDrawn") {
13643 waveRect.selectAll("path").attr("style", nodeStyles);
13644 }
13645 updateNodeBounds(node, waveRect);
13646 node.intersect = function(point) {
13647 const pos = intersect_default.polygon(node, points, point);
13648 return pos;
13649 };
13650 return shapeSvg;
13651 }
13652 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(waveRectangle, "waveRectangle");
13653
13654 // src/rendering-util/rendering-elements/shapes/windowPane.ts
13655
13656 async function windowPane(parent, node) {
13657 const { labelStyles, nodeStyles } = styles2String(node);
13658 node.labelStyle = labelStyles;
13659 const { shapeSvg, bbox, label } = await labelHelper(parent, node, getNodeClasses(node));
13660 const w = Math.max(bbox.width + (node.padding ?? 0) * 2, node?.width ?? 0);
13661 const h = Math.max(bbox.height + (node.padding ?? 0) * 2, node?.height ?? 0);
13662 const rectOffset = 5;
13663 const x = -w / 2;
13664 const y = -h / 2;
13665 const { cssStyles } = node;
13666 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
13667 const options = userNodeOverrides(node, {});
13668 const outerPathPoints = [
13669 { x: x - rectOffset, y: y - rectOffset },
13670 { x: x - rectOffset, y: y + h },
13671 { x: x + w, y: y + h },
13672 { x: x + w, y: y - rectOffset }
13673 ];
13674 const path = `M${x - rectOffset},${y - rectOffset} L${x + w},${y - rectOffset} L${x + w},${y + h} L${x - rectOffset},${y + h} L${x - rectOffset},${y - rectOffset}
13675 M${x - rectOffset},${y} L${x + w},${y}
13676 M${x},${y - rectOffset} L${x},${y + h}`;
13677 if (node.look !== "handDrawn") {
13678 options.roughness = 0;
13679 options.fillStyle = "solid";
13680 }
13681 const no = rc.path(path, options);
13682 const windowPane2 = shapeSvg.insert(() => no, ":first-child");
13683 windowPane2.attr("transform", `translate(${rectOffset / 2}, ${rectOffset / 2})`);
13684 windowPane2.attr("class", "basic label-container");
13685 if (cssStyles && node.look !== "handDrawn") {
13686 windowPane2.selectAll("path").attr("style", cssStyles);
13687 }
13688 if (nodeStyles && node.look !== "handDrawn") {
13689 windowPane2.selectAll("path").attr("style", nodeStyles);
13690 }
13691 label.attr(
13692 "transform",
13693 `translate(${-(bbox.width / 2) + rectOffset / 2 - (bbox.x - (bbox.left ?? 0))}, ${-(bbox.height / 2) + rectOffset / 2 - (bbox.y - (bbox.top ?? 0))})`
13694 );
13695 updateNodeBounds(node, windowPane2);
13696 node.intersect = function(point) {
13697 const pos = intersect_default.polygon(node, outerPathPoints, point);
13698 return pos;
13699 };
13700 return shapeSvg;
13701 }
13702 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(windowPane, "windowPane");
13703
13704 // src/rendering-util/rendering-elements/shapes/erBox.ts
13705
13706
13707 async function erBox(parent, node) {
13708 const entityNode = node;
13709 if (entityNode.alias) {
13710 node.label = entityNode.alias;
13711 }
13712 if (node.look === "handDrawn") {
13713 const { themeVariables: themeVariables2 } = (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig */ .iE)();
13714 const { background } = themeVariables2;
13715 const backgroundNode = {
13716 ...node,
13717 id: node.id + "-background",
13718 look: "default",
13719 cssStyles: ["stroke: none", `fill: ${background}`]
13720 };
13721 await erBox(parent, backgroundNode);
13722 }
13723 const config = (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig */ .iE)();
13724 node.useHtmlLabels = config.htmlLabels;
13725 let PADDING = config.er?.diagramPadding ?? 10;
13726 let TEXT_PADDING = config.er?.entityPadding ?? 6;
13727 const { cssStyles } = node;
13728 const { labelStyles } = styles2String(node);
13729 if (entityNode.attributes.length === 0 && node.label) {
13730 const options2 = {
13731 rx: 0,
13732 ry: 0,
13733 labelPaddingX: PADDING,
13734 labelPaddingY: PADDING * 1.5,
13735 classes: ""
13736 };
13737 if ((0,_chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .calculateTextWidth */ .Cq)(node.label, config) + options2.labelPaddingX * 2 < config.er.minEntityWidth) {
13738 node.width = config.er.minEntityWidth;
13739 }
13740 const shapeSvg2 = await drawRect(parent, node, options2);
13741 if (!(0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .evaluate */ .ku)(config.htmlLabels)) {
13742 const textElement = shapeSvg2.select("text");
13743 const bbox = textElement.node()?.getBBox();
13744 textElement.attr("transform", `translate(${-bbox.width / 2}, 0)`);
13745 }
13746 return shapeSvg2;
13747 }
13748 if (!config.htmlLabels) {
13749 PADDING *= 1.25;
13750 TEXT_PADDING *= 1.25;
13751 }
13752 let cssClasses = getNodeClasses(node);
13753 if (!cssClasses) {
13754 cssClasses = "node default";
13755 }
13756 const shapeSvg = parent.insert("g").attr("class", cssClasses).attr("id", node.domId || node.id);
13757 const nameBBox = await addText(shapeSvg, node.label ?? "", config, 0, 0, ["name"], labelStyles);
13758 nameBBox.height += TEXT_PADDING;
13759 let yOffset = 0;
13760 const yOffsets = [];
13761 let maxTypeWidth = 0;
13762 let maxNameWidth = 0;
13763 let maxKeysWidth = 0;
13764 let maxCommentWidth = 0;
13765 let keysPresent = true;
13766 let commentPresent = true;
13767 for (const attribute of entityNode.attributes) {
13768 const typeBBox = await addText(
13769 shapeSvg,
13770 attribute.type,
13771 config,
13772 0,
13773 yOffset,
13774 ["attribute-type"],
13775 labelStyles
13776 );
13777 maxTypeWidth = Math.max(maxTypeWidth, typeBBox.width + PADDING);
13778 const nameBBox2 = await addText(
13779 shapeSvg,
13780 attribute.name,
13781 config,
13782 0,
13783 yOffset,
13784 ["attribute-name"],
13785 labelStyles
13786 );
13787 maxNameWidth = Math.max(maxNameWidth, nameBBox2.width + PADDING);
13788 const keysBBox = await addText(
13789 shapeSvg,
13790 attribute.keys.join(),
13791 config,
13792 0,
13793 yOffset,
13794 ["attribute-keys"],
13795 labelStyles
13796 );
13797 maxKeysWidth = Math.max(maxKeysWidth, keysBBox.width + PADDING);
13798 const commentBBox = await addText(
13799 shapeSvg,
13800 attribute.comment,
13801 config,
13802 0,
13803 yOffset,
13804 ["attribute-comment"],
13805 labelStyles
13806 );
13807 maxCommentWidth = Math.max(maxCommentWidth, commentBBox.width + PADDING);
13808 yOffset += Math.max(typeBBox.height, nameBBox2.height, keysBBox.height, commentBBox.height) + TEXT_PADDING;
13809 yOffsets.push(yOffset);
13810 }
13811 yOffsets.pop();
13812 let totalWidthSections = 4;
13813 if (maxKeysWidth <= PADDING) {
13814 keysPresent = false;
13815 maxKeysWidth = 0;
13816 totalWidthSections--;
13817 }
13818 if (maxCommentWidth <= PADDING) {
13819 commentPresent = false;
13820 maxCommentWidth = 0;
13821 totalWidthSections--;
13822 }
13823 const shapeBBox = shapeSvg.node().getBBox();
13824 if (nameBBox.width + PADDING * 2 - (maxTypeWidth + maxNameWidth + maxKeysWidth + maxCommentWidth) > 0) {
13825 const difference = nameBBox.width + PADDING * 2 - (maxTypeWidth + maxNameWidth + maxKeysWidth + maxCommentWidth);
13826 maxTypeWidth += difference / totalWidthSections;
13827 maxNameWidth += difference / totalWidthSections;
13828 if (maxKeysWidth > 0) {
13829 maxKeysWidth += difference / totalWidthSections;
13830 }
13831 if (maxCommentWidth > 0) {
13832 maxCommentWidth += difference / totalWidthSections;
13833 }
13834 }
13835 const maxWidth = maxTypeWidth + maxNameWidth + maxKeysWidth + maxCommentWidth;
13836 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
13837 const options = userNodeOverrides(node, {});
13838 if (node.look !== "handDrawn") {
13839 options.roughness = 0;
13840 options.fillStyle = "solid";
13841 }
13842 const w = Math.max(shapeBBox.width + PADDING * 2, node?.width || 0, maxWidth);
13843 const h = Math.max(shapeBBox.height + (yOffsets[0] || yOffset) + TEXT_PADDING, node?.height || 0);
13844 const x = -w / 2;
13845 const y = -h / 2;
13846 shapeSvg.selectAll("g:not(:first-child)").each((_, i, nodes) => {
13847 const text2 = (0,d3__WEBPACK_IMPORTED_MODULE_5__/* .select */ .Ys)(nodes[i]);
13848 const transform = text2.attr("transform");
13849 let translateX = 0;
13850 let translateY = 0;
13851 if (transform) {
13852 const regex = RegExp(/translate\(([^,]+),([^)]+)\)/);
13853 const translate = regex.exec(transform);
13854 if (translate) {
13855 translateX = parseFloat(translate[1]);
13856 translateY = parseFloat(translate[2]);
13857 if (text2.attr("class").includes("attribute-name")) {
13858 translateX += maxTypeWidth;
13859 } else if (text2.attr("class").includes("attribute-keys")) {
13860 translateX += maxTypeWidth + maxNameWidth;
13861 } else if (text2.attr("class").includes("attribute-comment")) {
13862 translateX += maxTypeWidth + maxNameWidth + maxKeysWidth;
13863 }
13864 }
13865 }
13866 text2.attr(
13867 "transform",
13868 `translate(${x + PADDING / 2 + translateX}, ${translateY + y + nameBBox.height + TEXT_PADDING / 2})`
13869 );
13870 });
13871 shapeSvg.select(".name").attr("transform", "translate(" + -nameBBox.width / 2 + ", " + (y + TEXT_PADDING / 2) + ")");
13872 const roughRect = rc.rectangle(x, y, w, h, options);
13873 const rect2 = shapeSvg.insert(() => roughRect, ":first-child").attr("style", cssStyles.join(""));
13874 const { themeVariables } = (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig */ .iE)();
13875 const { rowEven, rowOdd, nodeBorder } = themeVariables;
13876 yOffsets.push(0);
13877 for (const [i, yOffset2] of yOffsets.entries()) {
13878 if (i === 0 && yOffsets.length > 1) {
13879 continue;
13880 }
13881 const isEven = i % 2 === 0 && yOffset2 !== 0;
13882 const roughRect2 = rc.rectangle(x, nameBBox.height + y + yOffset2, w, nameBBox.height, {
13883 ...options,
13884 fill: isEven ? rowEven : rowOdd,
13885 stroke: nodeBorder
13886 });
13887 shapeSvg.insert(() => roughRect2, "g.label").attr("style", cssStyles.join("")).attr("class", `row-rect-${i % 2 === 0 ? "even" : "odd"}`);
13888 }
13889 let roughLine = rc.line(x, nameBBox.height + y, w + x, nameBBox.height + y, options);
13890 shapeSvg.insert(() => roughLine).attr("class", "divider");
13891 roughLine = rc.line(maxTypeWidth + x, nameBBox.height + y, maxTypeWidth + x, h + y, options);
13892 shapeSvg.insert(() => roughLine).attr("class", "divider");
13893 if (keysPresent) {
13894 roughLine = rc.line(
13895 maxTypeWidth + maxNameWidth + x,
13896 nameBBox.height + y,
13897 maxTypeWidth + maxNameWidth + x,
13898 h + y,
13899 options
13900 );
13901 shapeSvg.insert(() => roughLine).attr("class", "divider");
13902 }
13903 if (commentPresent) {
13904 roughLine = rc.line(
13905 maxTypeWidth + maxNameWidth + maxKeysWidth + x,
13906 nameBBox.height + y,
13907 maxTypeWidth + maxNameWidth + maxKeysWidth + x,
13908 h + y,
13909 options
13910 );
13911 shapeSvg.insert(() => roughLine).attr("class", "divider");
13912 }
13913 for (const yOffset2 of yOffsets) {
13914 roughLine = rc.line(
13915 x,
13916 nameBBox.height + y + yOffset2,
13917 w + x,
13918 nameBBox.height + y + yOffset2,
13919 options
13920 );
13921 shapeSvg.insert(() => roughLine).attr("class", "divider");
13922 }
13923 updateNodeBounds(node, rect2);
13924 node.intersect = function(point) {
13925 return intersect_default.rect(node, point);
13926 };
13927 return shapeSvg;
13928 }
13929 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(erBox, "erBox");
13930 async function addText(shapeSvg, labelText, config, translateX = 0, translateY = 0, classes = [], style = "") {
13931 const label = shapeSvg.insert("g").attr("class", `label ${classes.join(" ")}`).attr("transform", `translate(${translateX}, ${translateY})`).attr("style", style);
13932 if (labelText !== (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .parseGenericTypes */ .UO)(labelText)) {
13933 labelText = (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .parseGenericTypes */ .UO)(labelText);
13934 labelText = labelText.replaceAll("<", "<").replaceAll(">", ">");
13935 }
13936 const text2 = label.node().appendChild(
13937 await (0,_chunk_C3MQ5ANM_mjs__WEBPACK_IMPORTED_MODULE_2__/* .createText */ .rw)(
13938 label,
13939 labelText,
13940 {
13941 width: (0,_chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .calculateTextWidth */ .Cq)(labelText, config) + 100,
13942 style,
13943 useHtmlLabels: config.htmlLabels
13944 },
13945 config
13946 )
13947 );
13948 if (labelText.includes("<") || labelText.includes(">")) {
13949 let child = text2.children[0];
13950 child.textContent = child.textContent.replaceAll("<", "<").replaceAll(">", ">");
13951 while (child.childNodes[0]) {
13952 child = child.childNodes[0];
13953 child.textContent = child.textContent.replaceAll("<", "<").replaceAll(">", ">");
13954 }
13955 }
13956 let bbox = text2.getBBox();
13957 if ((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .evaluate */ .ku)(config.htmlLabels)) {
13958 const div = text2.children[0];
13959 div.style.textAlign = "start";
13960 const dv = (0,d3__WEBPACK_IMPORTED_MODULE_5__/* .select */ .Ys)(text2);
13961 bbox = div.getBoundingClientRect();
13962 dv.attr("width", bbox.width);
13963 dv.attr("height", bbox.height);
13964 }
13965 return bbox;
13966 }
13967 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(addText, "addText");
13968
13969 // src/rendering-util/rendering-elements/shapes/classBox.ts
13970
13971
13972
13973 // src/diagrams/class/shapeUtil.ts
13974
13975 async function textHelper(parent, node, config, useHtmlLabels, GAP = config.class.padding ?? 12) {
13976 const TEXT_PADDING = !useHtmlLabels ? 3 : 0;
13977 const shapeSvg = parent.insert("g").attr("class", getNodeClasses(node)).attr("id", node.domId || node.id);
13978 let annotationGroup = null;
13979 let labelGroup = null;
13980 let membersGroup = null;
13981 let methodsGroup = null;
13982 let annotationGroupHeight = 0;
13983 let labelGroupHeight = 0;
13984 let membersGroupHeight = 0;
13985 annotationGroup = shapeSvg.insert("g").attr("class", "annotation-group text");
13986 if (node.annotations.length > 0) {
13987 const annotation = node.annotations[0];
13988 await addText2(annotationGroup, { text: `\xAB${annotation}\xBB` }, 0);
13989 const annotationGroupBBox = annotationGroup.node().getBBox();
13990 annotationGroupHeight = annotationGroupBBox.height;
13991 }
13992 labelGroup = shapeSvg.insert("g").attr("class", "label-group text");
13993 await addText2(labelGroup, node, 0, ["font-weight: bolder"]);
13994 const labelGroupBBox = labelGroup.node().getBBox();
13995 labelGroupHeight = labelGroupBBox.height;
13996 membersGroup = shapeSvg.insert("g").attr("class", "members-group text");
13997 let yOffset = 0;
13998 for (const member of node.members) {
13999 const height = await addText2(membersGroup, member, yOffset, [member.parseClassifier()]);
14000 yOffset += height + TEXT_PADDING;
14001 }
14002 membersGroupHeight = membersGroup.node().getBBox().height;
14003 if (membersGroupHeight <= 0) {
14004 membersGroupHeight = GAP / 2;
14005 }
14006 methodsGroup = shapeSvg.insert("g").attr("class", "methods-group text");
14007 let methodsYOffset = 0;
14008 for (const method of node.methods) {
14009 const height = await addText2(methodsGroup, method, methodsYOffset, [method.parseClassifier()]);
14010 methodsYOffset += height + TEXT_PADDING;
14011 }
14012 let bbox = shapeSvg.node().getBBox();
14013 if (annotationGroup !== null) {
14014 const annotationGroupBBox = annotationGroup.node().getBBox();
14015 annotationGroup.attr("transform", `translate(${-annotationGroupBBox.width / 2})`);
14016 }
14017 labelGroup.attr("transform", `translate(${-labelGroupBBox.width / 2}, ${annotationGroupHeight})`);
14018 bbox = shapeSvg.node().getBBox();
14019 membersGroup.attr(
14020 "transform",
14021 `translate(${0}, ${annotationGroupHeight + labelGroupHeight + GAP * 2})`
14022 );
14023 bbox = shapeSvg.node().getBBox();
14024 methodsGroup.attr(
14025 "transform",
14026 `translate(${0}, ${annotationGroupHeight + labelGroupHeight + (membersGroupHeight ? membersGroupHeight + GAP * 4 : GAP * 2)})`
14027 );
14028 bbox = shapeSvg.node().getBBox();
14029 return { shapeSvg, bbox };
14030 }
14031 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(textHelper, "textHelper");
14032 async function addText2(parentGroup, node, yOffset, styles = []) {
14033 const textEl = parentGroup.insert("g").attr("class", "label").attr("style", styles.join("; "));
14034 const config = (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig */ .iE)();
14035 let useHtmlLabels = "useHtmlLabels" in node ? node.useHtmlLabels : (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .evaluate */ .ku)(config.htmlLabels) ?? true;
14036 let textContent = "";
14037 if ("text" in node) {
14038 textContent = node.text;
14039 } else {
14040 textContent = node.label;
14041 }
14042 if (!useHtmlLabels && textContent.startsWith("\\")) {
14043 textContent = textContent.substring(1);
14044 }
14045 if ((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .hasKatex */ .l0)(textContent)) {
14046 useHtmlLabels = true;
14047 }
14048 const text2 = await (0,_chunk_C3MQ5ANM_mjs__WEBPACK_IMPORTED_MODULE_2__/* .createText */ .rw)(
14049 textEl,
14050 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .sanitizeText2 */ .uX)((0,_chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .decodeEntities */ .SH)(textContent)),
14051 {
14052 width: (0,_chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .calculateTextWidth */ .Cq)(textContent, config) + 50,
14053 // Add room for error when splitting text into multiple lines
14054 classes: "markdown-node-label",
14055 useHtmlLabels
14056 },
14057 config
14058 );
14059 let bbox;
14060 let numberOfLines = 1;
14061 if (!useHtmlLabels) {
14062 if (styles.includes("font-weight: bolder")) {
14063 (0,d3__WEBPACK_IMPORTED_MODULE_5__/* .select */ .Ys)(text2).selectAll("tspan").attr("font-weight", "");
14064 }
14065 numberOfLines = text2.children.length;
14066 const textChild = text2.children[0];
14067 if (text2.textContent === "" || text2.textContent.includes(">")) {
14068 textChild.textContent = textContent[0] + textContent.substring(1).replaceAll(">", ">").replaceAll("<", "<").trim();
14069 const preserveSpace = textContent[1] === " ";
14070 if (preserveSpace) {
14071 textChild.textContent = textChild.textContent[0] + " " + textChild.textContent.substring(1);
14072 }
14073 }
14074 if (textChild.textContent === "undefined") {
14075 textChild.textContent = "";
14076 }
14077 bbox = text2.getBBox();
14078 } else {
14079 const div = text2.children[0];
14080 const dv = (0,d3__WEBPACK_IMPORTED_MODULE_5__/* .select */ .Ys)(text2);
14081 numberOfLines = div.innerHTML.split("<br>").length;
14082 if (div.innerHTML.includes("</math>")) {
14083 numberOfLines += div.innerHTML.split("<mrow>").length - 1;
14084 }
14085 const images = div.getElementsByTagName("img");
14086 if (images) {
14087 const noImgText = textContent.replace(/<img[^>]*>/g, "").trim() === "";
14088 await Promise.all(
14089 [...images].map(
14090 (img) => new Promise((res) => {
14091 function setupImage() {
14092 img.style.display = "flex";
14093 img.style.flexDirection = "column";
14094 if (noImgText) {
14095 const bodyFontSize = config.fontSize?.toString() ?? window.getComputedStyle(document.body).fontSize;
14096 const enlargingFactor = 5;
14097 const width = parseInt(bodyFontSize, 10) * enlargingFactor + "px";
14098 img.style.minWidth = width;
14099 img.style.maxWidth = width;
14100 } else {
14101 img.style.width = "100%";
14102 }
14103 res(img);
14104 }
14105 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(setupImage, "setupImage");
14106 setTimeout(() => {
14107 if (img.complete) {
14108 setupImage();
14109 }
14110 });
14111 img.addEventListener("error", setupImage);
14112 img.addEventListener("load", setupImage);
14113 })
14114 )
14115 );
14116 }
14117 bbox = div.getBoundingClientRect();
14118 dv.attr("width", bbox.width);
14119 dv.attr("height", bbox.height);
14120 }
14121 textEl.attr("transform", "translate(0," + (-bbox.height / (2 * numberOfLines) + yOffset) + ")");
14122 return bbox.height;
14123 }
14124 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(addText2, "addText");
14125
14126 // src/rendering-util/rendering-elements/shapes/classBox.ts
14127 async function classBox(parent, node) {
14128 const config = (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .nV)();
14129 const PADDING = config.class.padding ?? 12;
14130 const GAP = PADDING;
14131 const useHtmlLabels = node.useHtmlLabels ?? (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .evaluate */ .ku)(config.htmlLabels) ?? true;
14132 const classNode = node;
14133 classNode.annotations = classNode.annotations ?? [];
14134 classNode.members = classNode.members ?? [];
14135 classNode.methods = classNode.methods ?? [];
14136 const { shapeSvg, bbox } = await textHelper(parent, node, config, useHtmlLabels, GAP);
14137 const { labelStyles, nodeStyles } = styles2String(node);
14138 node.labelStyle = labelStyles;
14139 node.cssStyles = classNode.styles || "";
14140 const styles = classNode.styles?.join(";") || nodeStyles || "";
14141 if (!node.cssStyles) {
14142 node.cssStyles = styles.replaceAll("!important", "").split(";");
14143 }
14144 const renderExtraBox = classNode.members.length === 0 && classNode.methods.length === 0 && !config.class?.hideEmptyMembersBox;
14145 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
14146 const options = userNodeOverrides(node, {});
14147 if (node.look !== "handDrawn") {
14148 options.roughness = 0;
14149 options.fillStyle = "solid";
14150 }
14151 const w = bbox.width;
14152 let h = bbox.height;
14153 if (classNode.members.length === 0 && classNode.methods.length === 0) {
14154 h += GAP;
14155 } else if (classNode.members.length > 0 && classNode.methods.length === 0) {
14156 h += GAP * 2;
14157 }
14158 const x = -w / 2;
14159 const y = -h / 2;
14160 const roughRect = rc.rectangle(
14161 x - PADDING,
14162 y - PADDING - (renderExtraBox ? PADDING : classNode.members.length === 0 && classNode.methods.length === 0 ? -PADDING / 2 : 0),
14163 w + 2 * PADDING,
14164 h + 2 * PADDING + (renderExtraBox ? PADDING * 2 : classNode.members.length === 0 && classNode.methods.length === 0 ? -PADDING : 0),
14165 options
14166 );
14167 const rect2 = shapeSvg.insert(() => roughRect, ":first-child");
14168 rect2.attr("class", "basic label-container");
14169 const rectBBox = rect2.node().getBBox();
14170 shapeSvg.selectAll(".text").each((_, i, nodes) => {
14171 const text2 = (0,d3__WEBPACK_IMPORTED_MODULE_5__/* .select */ .Ys)(nodes[i]);
14172 const transform = text2.attr("transform");
14173 let translateY = 0;
14174 if (transform) {
14175 const regex = RegExp(/translate\(([^,]+),([^)]+)\)/);
14176 const translate = regex.exec(transform);
14177 if (translate) {
14178 translateY = parseFloat(translate[2]);
14179 }
14180 }
14181 let newTranslateY = translateY + y + PADDING - (renderExtraBox ? PADDING : classNode.members.length === 0 && classNode.methods.length === 0 ? -PADDING / 2 : 0);
14182 if (!useHtmlLabels) {
14183 newTranslateY -= 4;
14184 }
14185 let newTranslateX = x;
14186 if (text2.attr("class").includes("label-group") || text2.attr("class").includes("annotation-group")) {
14187 newTranslateX = -text2.node()?.getBBox().width / 2 || 0;
14188 shapeSvg.selectAll("text").each(function(_2, i2, nodes2) {
14189 if (window.getComputedStyle(nodes2[i2]).textAnchor === "middle") {
14190 newTranslateX = 0;
14191 }
14192 });
14193 }
14194 text2.attr("transform", `translate(${newTranslateX}, ${newTranslateY})`);
14195 });
14196 const annotationGroupHeight = shapeSvg.select(".annotation-group").node().getBBox().height - (renderExtraBox ? PADDING / 2 : 0) || 0;
14197 const labelGroupHeight = shapeSvg.select(".label-group").node().getBBox().height - (renderExtraBox ? PADDING / 2 : 0) || 0;
14198 const membersGroupHeight = shapeSvg.select(".members-group").node().getBBox().height - (renderExtraBox ? PADDING / 2 : 0) || 0;
14199 if (classNode.members.length > 0 || classNode.methods.length > 0 || renderExtraBox) {
14200 const roughLine = rc.line(
14201 rectBBox.x,
14202 annotationGroupHeight + labelGroupHeight + y + PADDING,
14203 rectBBox.x + rectBBox.width,
14204 annotationGroupHeight + labelGroupHeight + y + PADDING,
14205 options
14206 );
14207 const line = shapeSvg.insert(() => roughLine);
14208 line.attr("class", "divider").attr("style", styles);
14209 }
14210 if (renderExtraBox || classNode.members.length > 0 || classNode.methods.length > 0) {
14211 const roughLine = rc.line(
14212 rectBBox.x,
14213 annotationGroupHeight + labelGroupHeight + membersGroupHeight + y + GAP * 2 + PADDING,
14214 rectBBox.x + rectBBox.width,
14215 annotationGroupHeight + labelGroupHeight + membersGroupHeight + y + PADDING + GAP * 2,
14216 options
14217 );
14218 const line = shapeSvg.insert(() => roughLine);
14219 line.attr("class", "divider").attr("style", styles);
14220 }
14221 if (classNode.look !== "handDrawn") {
14222 shapeSvg.selectAll("path").attr("style", styles);
14223 }
14224 rect2.select(":nth-child(2)").attr("style", styles);
14225 shapeSvg.selectAll(".divider").select("path").attr("style", styles);
14226 if (node.labelStyle) {
14227 shapeSvg.selectAll("span").attr("style", node.labelStyle);
14228 } else {
14229 shapeSvg.selectAll("span").attr("style", styles);
14230 }
14231 if (!useHtmlLabels) {
14232 const colorRegex = RegExp(/color\s*:\s*([^;]*)/);
14233 const match = colorRegex.exec(styles);
14234 if (match) {
14235 const colorStyle = match[0].replace("color", "fill");
14236 shapeSvg.selectAll("tspan").attr("style", colorStyle);
14237 } else if (labelStyles) {
14238 const match2 = colorRegex.exec(labelStyles);
14239 if (match2) {
14240 const colorStyle = match2[0].replace("color", "fill");
14241 shapeSvg.selectAll("tspan").attr("style", colorStyle);
14242 }
14243 }
14244 }
14245 updateNodeBounds(node, rect2);
14246 node.intersect = function(point) {
14247 return intersect_default.rect(node, point);
14248 };
14249 return shapeSvg;
14250 }
14251 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(classBox, "classBox");
14252
14253 // src/rendering-util/rendering-elements/shapes/requirementBox.ts
14254
14255
14256 async function requirementBox(parent, node) {
14257 const { labelStyles, nodeStyles } = styles2String(node);
14258 node.labelStyle = labelStyles;
14259 const requirementNode = node;
14260 const elementNode = node;
14261 const padding = 20;
14262 const gap = 20;
14263 const isRequirementNode = "verifyMethod" in node;
14264 const classes = getNodeClasses(node);
14265 const shapeSvg = parent.insert("g").attr("class", classes).attr("id", node.domId ?? node.id);
14266 let typeHeight;
14267 if (isRequirementNode) {
14268 typeHeight = await addText3(
14269 shapeSvg,
14270 `<<${requirementNode.type}>>`,
14271 0,
14272 node.labelStyle
14273 );
14274 } else {
14275 typeHeight = await addText3(shapeSvg, "<<Element>>", 0, node.labelStyle);
14276 }
14277 let accumulativeHeight = typeHeight;
14278 const nameHeight = await addText3(
14279 shapeSvg,
14280 requirementNode.name,
14281 accumulativeHeight,
14282 node.labelStyle + "; font-weight: bold;"
14283 );
14284 accumulativeHeight += nameHeight + gap;
14285 if (isRequirementNode) {
14286 const idHeight = await addText3(
14287 shapeSvg,
14288 `${requirementNode.requirementId ? `Id: ${requirementNode.requirementId}` : ""}`,
14289 accumulativeHeight,
14290 node.labelStyle
14291 );
14292 accumulativeHeight += idHeight;
14293 const textHeight = await addText3(
14294 shapeSvg,
14295 `${requirementNode.text ? `Text: ${requirementNode.text}` : ""}`,
14296 accumulativeHeight,
14297 node.labelStyle
14298 );
14299 accumulativeHeight += textHeight;
14300 const riskHeight = await addText3(
14301 shapeSvg,
14302 `${requirementNode.risk ? `Risk: ${requirementNode.risk}` : ""}`,
14303 accumulativeHeight,
14304 node.labelStyle
14305 );
14306 accumulativeHeight += riskHeight;
14307 await addText3(
14308 shapeSvg,
14309 `${requirementNode.verifyMethod ? `Verification: ${requirementNode.verifyMethod}` : ""}`,
14310 accumulativeHeight,
14311 node.labelStyle
14312 );
14313 } else {
14314 const typeHeight2 = await addText3(
14315 shapeSvg,
14316 `${elementNode.type ? `Type: ${elementNode.type}` : ""}`,
14317 accumulativeHeight,
14318 node.labelStyle
14319 );
14320 accumulativeHeight += typeHeight2;
14321 await addText3(
14322 shapeSvg,
14323 `${elementNode.docRef ? `Doc Ref: ${elementNode.docRef}` : ""}`,
14324 accumulativeHeight,
14325 node.labelStyle
14326 );
14327 }
14328 const totalWidth = (shapeSvg.node()?.getBBox().width ?? 200) + padding;
14329 const totalHeight = (shapeSvg.node()?.getBBox().height ?? 200) + padding;
14330 const x = -totalWidth / 2;
14331 const y = -totalHeight / 2;
14332 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
14333 const options = userNodeOverrides(node, {});
14334 if (node.look !== "handDrawn") {
14335 options.roughness = 0;
14336 options.fillStyle = "solid";
14337 }
14338 const roughRect = rc.rectangle(x, y, totalWidth, totalHeight, options);
14339 const rect2 = shapeSvg.insert(() => roughRect, ":first-child");
14340 rect2.attr("class", "basic label-container").attr("style", nodeStyles);
14341 shapeSvg.selectAll(".label").each((_, i, nodes) => {
14342 const text2 = (0,d3__WEBPACK_IMPORTED_MODULE_5__/* .select */ .Ys)(nodes[i]);
14343 const transform = text2.attr("transform");
14344 let translateX = 0;
14345 let translateY = 0;
14346 if (transform) {
14347 const regex = RegExp(/translate\(([^,]+),([^)]+)\)/);
14348 const translate = regex.exec(transform);
14349 if (translate) {
14350 translateX = parseFloat(translate[1]);
14351 translateY = parseFloat(translate[2]);
14352 }
14353 }
14354 const newTranslateY = translateY - totalHeight / 2;
14355 let newTranslateX = x + padding / 2;
14356 if (i === 0 || i === 1) {
14357 newTranslateX = translateX;
14358 }
14359 text2.attr("transform", `translate(${newTranslateX}, ${newTranslateY + padding})`);
14360 });
14361 if (accumulativeHeight > typeHeight + nameHeight + gap) {
14362 const roughLine = rc.line(
14363 x,
14364 y + typeHeight + nameHeight + gap,
14365 x + totalWidth,
14366 y + typeHeight + nameHeight + gap,
14367 options
14368 );
14369 const dividerLine = shapeSvg.insert(() => roughLine);
14370 dividerLine.attr("style", nodeStyles);
14371 }
14372 updateNodeBounds(node, rect2);
14373 node.intersect = function(point) {
14374 return intersect_default.rect(node, point);
14375 };
14376 return shapeSvg;
14377 }
14378 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(requirementBox, "requirementBox");
14379 async function addText3(parentGroup, inputText, yOffset, style = "") {
14380 if (inputText === "") {
14381 return 0;
14382 }
14383 const textEl = parentGroup.insert("g").attr("class", "label").attr("style", style);
14384 const config = (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .nV)();
14385 const useHtmlLabels = config.htmlLabels ?? true;
14386 const text2 = await (0,_chunk_C3MQ5ANM_mjs__WEBPACK_IMPORTED_MODULE_2__/* .createText */ .rw)(
14387 textEl,
14388 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .sanitizeText2 */ .uX)((0,_chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .decodeEntities */ .SH)(inputText)),
14389 {
14390 width: (0,_chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .calculateTextWidth */ .Cq)(inputText, config) + 50,
14391 // Add room for error when splitting text into multiple lines
14392 classes: "markdown-node-label",
14393 useHtmlLabels,
14394 style
14395 },
14396 config
14397 );
14398 let bbox;
14399 if (!useHtmlLabels) {
14400 const textChild = text2.children[0];
14401 for (const child of textChild.children) {
14402 child.textContent = child.textContent.replaceAll(">", ">").replaceAll("<", "<");
14403 if (style) {
14404 child.setAttribute("style", style);
14405 }
14406 }
14407 bbox = text2.getBBox();
14408 bbox.height += 6;
14409 } else {
14410 const div = text2.children[0];
14411 const dv = (0,d3__WEBPACK_IMPORTED_MODULE_5__/* .select */ .Ys)(text2);
14412 bbox = div.getBoundingClientRect();
14413 dv.attr("width", bbox.width);
14414 dv.attr("height", bbox.height);
14415 }
14416 textEl.attr("transform", `translate(${-bbox.width / 2},${-bbox.height / 2 + yOffset})`);
14417 return bbox.height;
14418 }
14419 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(addText3, "addText");
14420
14421 // src/rendering-util/rendering-elements/shapes/kanbanItem.ts
14422
14423 var colorFromPriority = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)((priority) => {
14424 switch (priority) {
14425 case "Very High":
14426 return "red";
14427 case "High":
14428 return "orange";
14429 case "Medium":
14430 return null;
14431 // no stroke
14432 case "Low":
14433 return "blue";
14434 case "Very Low":
14435 return "lightblue";
14436 }
14437 }, "colorFromPriority");
14438 async function kanbanItem(parent, kanbanNode, { config }) {
14439 const { labelStyles, nodeStyles } = styles2String(kanbanNode);
14440 kanbanNode.labelStyle = labelStyles || "";
14441 const labelPaddingX = 10;
14442 const orgWidth = kanbanNode.width;
14443 kanbanNode.width = (kanbanNode.width ?? 200) - 10;
14444 const {
14445 shapeSvg,
14446 bbox,
14447 label: labelElTitle
14448 } = await labelHelper(parent, kanbanNode, getNodeClasses(kanbanNode));
14449 const padding = kanbanNode.padding || 10;
14450 let ticketUrl = "";
14451 let link;
14452 if ("ticket" in kanbanNode && kanbanNode.ticket && config?.kanban?.ticketBaseUrl) {
14453 ticketUrl = config?.kanban?.ticketBaseUrl.replace("#TICKET#", kanbanNode.ticket);
14454 link = shapeSvg.insert("svg:a", ":first-child").attr("class", "kanban-ticket-link").attr("xlink:href", ticketUrl).attr("target", "_blank");
14455 }
14456 const options = {
14457 useHtmlLabels: kanbanNode.useHtmlLabels,
14458 labelStyle: kanbanNode.labelStyle || "",
14459 width: kanbanNode.width,
14460 img: kanbanNode.img,
14461 padding: kanbanNode.padding || 8,
14462 centerLabel: false
14463 };
14464 let labelEl, bbox2;
14465 if (link) {
14466 ({ label: labelEl, bbox: bbox2 } = await insertLabel(
14467 link,
14468 "ticket" in kanbanNode && kanbanNode.ticket || "",
14469 options
14470 ));
14471 } else {
14472 ({ label: labelEl, bbox: bbox2 } = await insertLabel(
14473 shapeSvg,
14474 "ticket" in kanbanNode && kanbanNode.ticket || "",
14475 options
14476 ));
14477 }
14478 const { label: labelElAssigned, bbox: bboxAssigned } = await insertLabel(
14479 shapeSvg,
14480 "assigned" in kanbanNode && kanbanNode.assigned || "",
14481 options
14482 );
14483 kanbanNode.width = orgWidth;
14484 const labelPaddingY = 10;
14485 const totalWidth = kanbanNode?.width || 0;
14486 const heightAdj = Math.max(bbox2.height, bboxAssigned.height) / 2;
14487 const totalHeight = Math.max(bbox.height + labelPaddingY * 2, kanbanNode?.height || 0) + heightAdj;
14488 const x = -totalWidth / 2;
14489 const y = -totalHeight / 2;
14490 labelElTitle.attr(
14491 "transform",
14492 "translate(" + (padding - totalWidth / 2) + ", " + (-heightAdj - bbox.height / 2) + ")"
14493 );
14494 labelEl.attr(
14495 "transform",
14496 "translate(" + (padding - totalWidth / 2) + ", " + (-heightAdj + bbox.height / 2) + ")"
14497 );
14498 labelElAssigned.attr(
14499 "transform",
14500 "translate(" + (padding + totalWidth / 2 - bboxAssigned.width - 2 * labelPaddingX) + ", " + (-heightAdj + bbox.height / 2) + ")"
14501 );
14502 let rect2;
14503 const { rx, ry } = kanbanNode;
14504 const { cssStyles } = kanbanNode;
14505 if (kanbanNode.look === "handDrawn") {
14506 const rc = roughjs__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.svg(shapeSvg);
14507 const options2 = userNodeOverrides(kanbanNode, {});
14508 const roughNode = rx || ry ? rc.path(createRoundedRectPathD(x, y, totalWidth, totalHeight, rx || 0), options2) : rc.rectangle(x, y, totalWidth, totalHeight, options2);
14509 rect2 = shapeSvg.insert(() => roughNode, ":first-child");
14510 rect2.attr("class", "basic label-container").attr("style", cssStyles ? cssStyles : null);
14511 } else {
14512 rect2 = shapeSvg.insert("rect", ":first-child");
14513 rect2.attr("class", "basic label-container __APA__").attr("style", nodeStyles).attr("rx", rx ?? 5).attr("ry", ry ?? 5).attr("x", x).attr("y", y).attr("width", totalWidth).attr("height", totalHeight);
14514 const priority = "priority" in kanbanNode && kanbanNode.priority;
14515 if (priority) {
14516 const line = shapeSvg.append("line");
14517 const lineX = x + 2;
14518 const y1 = y + Math.floor((rx ?? 0) / 2);
14519 const y2 = y + totalHeight - Math.floor((rx ?? 0) / 2);
14520 line.attr("x1", lineX).attr("y1", y1).attr("x2", lineX).attr("y2", y2).attr("stroke-width", "4").attr("stroke", colorFromPriority(priority));
14521 }
14522 }
14523 updateNodeBounds(kanbanNode, rect2);
14524 kanbanNode.height = totalHeight;
14525 kanbanNode.intersect = function(point) {
14526 return intersect_default.rect(kanbanNode, point);
14527 };
14528 return shapeSvg;
14529 }
14530 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(kanbanItem, "kanbanItem");
14531
14532 // src/rendering-util/rendering-elements/shapes.ts
14533 var shapesDefs = [
14534 {
14535 semanticName: "Process",
14536 name: "Rectangle",
14537 shortName: "rect",
14538 description: "Standard process shape",
14539 aliases: ["proc", "process", "rectangle"],
14540 internalAliases: ["squareRect"],
14541 handler: squareRect2
14542 },
14543 {
14544 semanticName: "Event",
14545 name: "Rounded Rectangle",
14546 shortName: "rounded",
14547 description: "Represents an event",
14548 aliases: ["event"],
14549 internalAliases: ["roundedRect"],
14550 handler: roundedRect
14551 },
14552 {
14553 semanticName: "Terminal Point",
14554 name: "Stadium",
14555 shortName: "stadium",
14556 description: "Terminal point",
14557 aliases: ["terminal", "pill"],
14558 handler: stadium
14559 },
14560 {
14561 semanticName: "Subprocess",
14562 name: "Framed Rectangle",
14563 shortName: "fr-rect",
14564 description: "Subprocess",
14565 aliases: ["subprocess", "subproc", "framed-rectangle", "subroutine"],
14566 handler: subroutine
14567 },
14568 {
14569 semanticName: "Database",
14570 name: "Cylinder",
14571 shortName: "cyl",
14572 description: "Database storage",
14573 aliases: ["db", "database", "cylinder"],
14574 handler: cylinder
14575 },
14576 {
14577 semanticName: "Start",
14578 name: "Circle",
14579 shortName: "circle",
14580 description: "Starting point",
14581 aliases: ["circ"],
14582 handler: circle
14583 },
14584 {
14585 semanticName: "Decision",
14586 name: "Diamond",
14587 shortName: "diam",
14588 description: "Decision-making step",
14589 aliases: ["decision", "diamond", "question"],
14590 handler: question
14591 },
14592 {
14593 semanticName: "Prepare Conditional",
14594 name: "Hexagon",
14595 shortName: "hex",
14596 description: "Preparation or condition step",
14597 aliases: ["hexagon", "prepare"],
14598 handler: hexagon
14599 },
14600 {
14601 semanticName: "Data Input/Output",
14602 name: "Lean Right",
14603 shortName: "lean-r",
14604 description: "Represents input or output",
14605 aliases: ["lean-right", "in-out"],
14606 internalAliases: ["lean_right"],
14607 handler: lean_right
14608 },
14609 {
14610 semanticName: "Data Input/Output",
14611 name: "Lean Left",
14612 shortName: "lean-l",
14613 description: "Represents output or input",
14614 aliases: ["lean-left", "out-in"],
14615 internalAliases: ["lean_left"],
14616 handler: lean_left
14617 },
14618 {
14619 semanticName: "Priority Action",
14620 name: "Trapezoid Base Bottom",
14621 shortName: "trap-b",
14622 description: "Priority action",
14623 aliases: ["priority", "trapezoid-bottom", "trapezoid"],
14624 handler: trapezoid
14625 },
14626 {
14627 semanticName: "Manual Operation",
14628 name: "Trapezoid Base Top",
14629 shortName: "trap-t",
14630 description: "Represents a manual task",
14631 aliases: ["manual", "trapezoid-top", "inv-trapezoid"],
14632 internalAliases: ["inv_trapezoid"],
14633 handler: inv_trapezoid
14634 },
14635 {
14636 semanticName: "Stop",
14637 name: "Double Circle",
14638 shortName: "dbl-circ",
14639 description: "Represents a stop point",
14640 aliases: ["double-circle"],
14641 internalAliases: ["doublecircle"],
14642 handler: doublecircle
14643 },
14644 {
14645 semanticName: "Text Block",
14646 name: "Text Block",
14647 shortName: "text",
14648 description: "Text block",
14649 handler: text
14650 },
14651 {
14652 semanticName: "Card",
14653 name: "Notched Rectangle",
14654 shortName: "notch-rect",
14655 description: "Represents a card",
14656 aliases: ["card", "notched-rectangle"],
14657 handler: card
14658 },
14659 {
14660 semanticName: "Lined/Shaded Process",
14661 name: "Lined Rectangle",
14662 shortName: "lin-rect",
14663 description: "Lined process shape",
14664 aliases: ["lined-rectangle", "lined-process", "lin-proc", "shaded-process"],
14665 handler: shadedProcess
14666 },
14667 {
14668 semanticName: "Start",
14669 name: "Small Circle",
14670 shortName: "sm-circ",
14671 description: "Small starting point",
14672 aliases: ["start", "small-circle"],
14673 internalAliases: ["stateStart"],
14674 handler: stateStart
14675 },
14676 {
14677 semanticName: "Stop",
14678 name: "Framed Circle",
14679 shortName: "fr-circ",
14680 description: "Stop point",
14681 aliases: ["stop", "framed-circle"],
14682 internalAliases: ["stateEnd"],
14683 handler: stateEnd
14684 },
14685 {
14686 semanticName: "Fork/Join",
14687 name: "Filled Rectangle",
14688 shortName: "fork",
14689 description: "Fork or join in process flow",
14690 aliases: ["join"],
14691 internalAliases: ["forkJoin"],
14692 handler: forkJoin
14693 },
14694 {
14695 semanticName: "Collate",
14696 name: "Hourglass",
14697 shortName: "hourglass",
14698 description: "Represents a collate operation",
14699 aliases: ["hourglass", "collate"],
14700 handler: hourglass
14701 },
14702 {
14703 semanticName: "Comment",
14704 name: "Curly Brace",
14705 shortName: "brace",
14706 description: "Adds a comment",
14707 aliases: ["comment", "brace-l"],
14708 handler: curlyBraceLeft
14709 },
14710 {
14711 semanticName: "Comment Right",
14712 name: "Curly Brace",
14713 shortName: "brace-r",
14714 description: "Adds a comment",
14715 handler: curlyBraceRight
14716 },
14717 {
14718 semanticName: "Comment with braces on both sides",
14719 name: "Curly Braces",
14720 shortName: "braces",
14721 description: "Adds a comment",
14722 handler: curlyBraces
14723 },
14724 {
14725 semanticName: "Com Link",
14726 name: "Lightning Bolt",
14727 shortName: "bolt",
14728 description: "Communication link",
14729 aliases: ["com-link", "lightning-bolt"],
14730 handler: lightningBolt
14731 },
14732 {
14733 semanticName: "Document",
14734 name: "Document",
14735 shortName: "doc",
14736 description: "Represents a document",
14737 aliases: ["doc", "document"],
14738 handler: waveEdgedRectangle
14739 },
14740 {
14741 semanticName: "Delay",
14742 name: "Half-Rounded Rectangle",
14743 shortName: "delay",
14744 description: "Represents a delay",
14745 aliases: ["half-rounded-rectangle"],
14746 handler: halfRoundedRectangle
14747 },
14748 {
14749 semanticName: "Direct Access Storage",
14750 name: "Horizontal Cylinder",
14751 shortName: "h-cyl",
14752 description: "Direct access storage",
14753 aliases: ["das", "horizontal-cylinder"],
14754 handler: tiltedCylinder
14755 },
14756 {
14757 semanticName: "Disk Storage",
14758 name: "Lined Cylinder",
14759 shortName: "lin-cyl",
14760 description: "Disk storage",
14761 aliases: ["disk", "lined-cylinder"],
14762 handler: linedCylinder
14763 },
14764 {
14765 semanticName: "Display",
14766 name: "Curved Trapezoid",
14767 shortName: "curv-trap",
14768 description: "Represents a display",
14769 aliases: ["curved-trapezoid", "display"],
14770 handler: curvedTrapezoid
14771 },
14772 {
14773 semanticName: "Divided Process",
14774 name: "Divided Rectangle",
14775 shortName: "div-rect",
14776 description: "Divided process shape",
14777 aliases: ["div-proc", "divided-rectangle", "divided-process"],
14778 handler: dividedRectangle
14779 },
14780 {
14781 semanticName: "Extract",
14782 name: "Triangle",
14783 shortName: "tri",
14784 description: "Extraction process",
14785 aliases: ["extract", "triangle"],
14786 handler: triangle
14787 },
14788 {
14789 semanticName: "Internal Storage",
14790 name: "Window Pane",
14791 shortName: "win-pane",
14792 description: "Internal storage",
14793 aliases: ["internal-storage", "window-pane"],
14794 handler: windowPane
14795 },
14796 {
14797 semanticName: "Junction",
14798 name: "Filled Circle",
14799 shortName: "f-circ",
14800 description: "Junction point",
14801 aliases: ["junction", "filled-circle"],
14802 handler: filledCircle
14803 },
14804 {
14805 semanticName: "Loop Limit",
14806 name: "Trapezoidal Pentagon",
14807 shortName: "notch-pent",
14808 description: "Loop limit step",
14809 aliases: ["loop-limit", "notched-pentagon"],
14810 handler: trapezoidalPentagon
14811 },
14812 {
14813 semanticName: "Manual File",
14814 name: "Flipped Triangle",
14815 shortName: "flip-tri",
14816 description: "Manual file operation",
14817 aliases: ["manual-file", "flipped-triangle"],
14818 handler: flippedTriangle
14819 },
14820 {
14821 semanticName: "Manual Input",
14822 name: "Sloped Rectangle",
14823 shortName: "sl-rect",
14824 description: "Manual input step",
14825 aliases: ["manual-input", "sloped-rectangle"],
14826 handler: slopedRect
14827 },
14828 {
14829 semanticName: "Multi-Document",
14830 name: "Stacked Document",
14831 shortName: "docs",
14832 description: "Multiple documents",
14833 aliases: ["documents", "st-doc", "stacked-document"],
14834 handler: multiWaveEdgedRectangle
14835 },
14836 {
14837 semanticName: "Multi-Process",
14838 name: "Stacked Rectangle",
14839 shortName: "st-rect",
14840 description: "Multiple processes",
14841 aliases: ["procs", "processes", "stacked-rectangle"],
14842 handler: multiRect
14843 },
14844 {
14845 semanticName: "Stored Data",
14846 name: "Bow Tie Rectangle",
14847 shortName: "bow-rect",
14848 description: "Stored data",
14849 aliases: ["stored-data", "bow-tie-rectangle"],
14850 handler: bowTieRect
14851 },
14852 {
14853 semanticName: "Summary",
14854 name: "Crossed Circle",
14855 shortName: "cross-circ",
14856 description: "Summary",
14857 aliases: ["summary", "crossed-circle"],
14858 handler: crossedCircle
14859 },
14860 {
14861 semanticName: "Tagged Document",
14862 name: "Tagged Document",
14863 shortName: "tag-doc",
14864 description: "Tagged document",
14865 aliases: ["tag-doc", "tagged-document"],
14866 handler: taggedWaveEdgedRectangle
14867 },
14868 {
14869 semanticName: "Tagged Process",
14870 name: "Tagged Rectangle",
14871 shortName: "tag-rect",
14872 description: "Tagged process",
14873 aliases: ["tagged-rectangle", "tag-proc", "tagged-process"],
14874 handler: taggedRect
14875 },
14876 {
14877 semanticName: "Paper Tape",
14878 name: "Flag",
14879 shortName: "flag",
14880 description: "Paper tape",
14881 aliases: ["paper-tape"],
14882 handler: waveRectangle
14883 },
14884 {
14885 semanticName: "Odd",
14886 name: "Odd",
14887 shortName: "odd",
14888 description: "Odd shape",
14889 internalAliases: ["rect_left_inv_arrow"],
14890 handler: rect_left_inv_arrow
14891 },
14892 {
14893 semanticName: "Lined Document",
14894 name: "Lined Document",
14895 shortName: "lin-doc",
14896 description: "Lined document",
14897 aliases: ["lined-document"],
14898 handler: linedWaveEdgedRect
14899 }
14900 ];
14901 var generateShapeMap = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(() => {
14902 const undocumentedShapes = {
14903 // States
14904 state,
14905 choice,
14906 note,
14907 // Rectangles
14908 rectWithTitle,
14909 labelRect,
14910 // Icons
14911 iconSquare,
14912 iconCircle,
14913 icon,
14914 iconRounded,
14915 imageSquare,
14916 anchor,
14917 // Kanban diagram
14918 kanbanItem,
14919 // class diagram
14920 classBox,
14921 // er diagram
14922 erBox,
14923 // Requirement diagram
14924 requirementBox
14925 };
14926 const entries = [
14927 ...Object.entries(undocumentedShapes),
14928 ...shapesDefs.flatMap((shape) => {
14929 const aliases = [
14930 shape.shortName,
14931 ..."aliases" in shape ? shape.aliases : [],
14932 ..."internalAliases" in shape ? shape.internalAliases : []
14933 ];
14934 return aliases.map((alias) => [alias, shape.handler]);
14935 })
14936 ];
14937 return Object.fromEntries(entries);
14938 }, "generateShapeMap");
14939 var shapes2 = generateShapeMap();
14940 function isValidShape(shape) {
14941 return shape in shapes2;
14942 }
14943 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(isValidShape, "isValidShape");
14944
14945 // src/rendering-util/rendering-elements/nodes.ts
14946 var nodeElems = /* @__PURE__ */ new Map();
14947 async function insertNode(elem, node, renderOptions) {
14948 let newEl;
14949 let el;
14950 if (node.shape === "rect") {
14951 if (node.rx && node.ry) {
14952 node.shape = "roundedRect";
14953 } else {
14954 node.shape = "squareRect";
14955 }
14956 }
14957 const shapeHandler = node.shape ? shapes2[node.shape] : void 0;
14958 if (!shapeHandler) {
14959 throw new Error(`No such shape: ${node.shape}. Please check your syntax.`);
14960 }
14961 if (node.link) {
14962 let target;
14963 if (renderOptions.config.securityLevel === "sandbox") {
14964 target = "_top";
14965 } else if (node.linkTarget) {
14966 target = node.linkTarget || "_blank";
14967 }
14968 newEl = elem.insert("svg:a").attr("xlink:href", node.link).attr("target", target ?? null);
14969 el = await shapeHandler(newEl, node, renderOptions);
14970 } else {
14971 el = await shapeHandler(elem, node, renderOptions);
14972 newEl = el;
14973 }
14974 if (node.tooltip) {
14975 el.attr("title", node.tooltip);
14976 }
14977 nodeElems.set(node.id, newEl);
14978 if (node.haveCallback) {
14979 newEl.attr("class", newEl.attr("class") + " clickable");
14980 }
14981 return newEl;
14982 }
14983 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(insertNode, "insertNode");
14984 var setNodeElem = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)((elem, node) => {
14985 nodeElems.set(node.id, elem);
14986 }, "setNodeElem");
14987 var clear2 = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)(() => {
14988 nodeElems.clear();
14989 }, "clear");
14990 var positionNode = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .eW)((node) => {
14991 const el = nodeElems.get(node.id);
14992 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .cM.trace(
14993 "Transforming node",
14994 node.diff,
14995 node,
14996 "translate(" + (node.x - node.width / 2 - 5) + ", " + node.width / 2 + ")"
14997 );
14998 const padding = 8;
14999 const diff = node.diff || 0;
15000 if (node.clusterNode) {
15001 el.attr(
15002 "transform",
15003 "translate(" + (node.x + diff - node.width / 2) + ", " + (node.y - node.height / 2 - padding) + ")"
15004 );
15005 } else {
15006 el.attr("transform", "translate(" + node.x + ", " + node.y + ")");
15007 }
15008 return diff;
15009 }, "positionNode");
15010
15011
15012
15013
15014 /***/ }),
15015
15016 /***/ 52017:
15017 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
15018
15019 "use strict";
15020 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
15021 /* harmony export */ DQ: () => (/* binding */ markers_default),
15022 /* harmony export */ I_: () => (/* binding */ insertEdgeLabel),
15023 /* harmony export */ Jj: () => (/* binding */ positionEdgeLabel),
15024 /* harmony export */ QP: () => (/* binding */ insertEdge),
15025 /* harmony export */ ZH: () => (/* binding */ clear)
15026 /* harmony export */ });
15027 /* harmony import */ var _chunk_VV3M67IP_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(83133);
15028 /* harmony import */ var _chunk_HRU6DDCH_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(41921);
15029 /* harmony import */ var _chunk_K557N5IZ_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(81861);
15030 /* harmony import */ var _chunk_C3MQ5ANM_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(39769);
15031 /* harmony import */ var _chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(42626);
15032 /* harmony import */ var _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(86906);
15033 /* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(83619);
15034 /* harmony import */ var roughjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(36366);
15035
15036
15037
15038
15039
15040
15041
15042 // src/rendering-util/rendering-elements/edges.js
15043
15044
15045
15046 // src/rendering-util/rendering-elements/edgeMarker.ts
15047 var addEdgeMarkers = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .__name */ .eW)((svgPath, edge, url, id, diagramType, strokeColor) => {
15048 if (edge.arrowTypeStart) {
15049 addEdgeMarker(svgPath, "start", edge.arrowTypeStart, url, id, diagramType, strokeColor);
15050 }
15051 if (edge.arrowTypeEnd) {
15052 addEdgeMarker(svgPath, "end", edge.arrowTypeEnd, url, id, diagramType, strokeColor);
15053 }
15054 }, "addEdgeMarkers");
15055 var arrowTypesMap = {
15056 arrow_cross: { type: "cross", fill: false },
15057 arrow_point: { type: "point", fill: true },
15058 arrow_barb: { type: "barb", fill: true },
15059 arrow_circle: { type: "circle", fill: false },
15060 aggregation: { type: "aggregation", fill: false },
15061 extension: { type: "extension", fill: false },
15062 composition: { type: "composition", fill: true },
15063 dependency: { type: "dependency", fill: true },
15064 lollipop: { type: "lollipop", fill: false },
15065 only_one: { type: "onlyOne", fill: false },
15066 zero_or_one: { type: "zeroOrOne", fill: false },
15067 one_or_more: { type: "oneOrMore", fill: false },
15068 zero_or_more: { type: "zeroOrMore", fill: false },
15069 requirement_arrow: { type: "requirement_arrow", fill: false },
15070 requirement_contains: { type: "requirement_contains", fill: false }
15071 };
15072 var addEdgeMarker = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .__name */ .eW)((svgPath, position, arrowType, url, id, diagramType, strokeColor) => {
15073 const arrowTypeInfo = arrowTypesMap[arrowType];
15074 if (!arrowTypeInfo) {
15075 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .log */ .cM.warn(`Unknown arrow type: ${arrowType}`);
15076 return;
15077 }
15078 const endMarkerType = arrowTypeInfo.type;
15079 const suffix = position === "start" ? "Start" : "End";
15080 const originalMarkerId = `${id}_${diagramType}-${endMarkerType}${suffix}`;
15081 if (strokeColor && strokeColor.trim() !== "") {
15082 const colorId = strokeColor.replace(/[^\dA-Za-z]/g, "_");
15083 const coloredMarkerId = `${originalMarkerId}_${colorId}`;
15084 if (!document.getElementById(coloredMarkerId)) {
15085 const originalMarker = document.getElementById(originalMarkerId);
15086 if (originalMarker) {
15087 const coloredMarker = originalMarker.cloneNode(true);
15088 coloredMarker.id = coloredMarkerId;
15089 const paths = coloredMarker.querySelectorAll("path, circle, line");
15090 paths.forEach((path) => {
15091 path.setAttribute("stroke", strokeColor);
15092 if (arrowTypeInfo.fill) {
15093 path.setAttribute("fill", strokeColor);
15094 }
15095 });
15096 originalMarker.parentNode?.appendChild(coloredMarker);
15097 }
15098 }
15099 svgPath.attr(`marker-${position}`, `url(${url}#${coloredMarkerId})`);
15100 } else {
15101 svgPath.attr(`marker-${position}`, `url(${url}#${originalMarkerId})`);
15102 }
15103 }, "addEdgeMarker");
15104
15105 // src/rendering-util/rendering-elements/edges.js
15106 var edgeLabels = /* @__PURE__ */ new Map();
15107 var terminalLabels = /* @__PURE__ */ new Map();
15108 var clear = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .__name */ .eW)(() => {
15109 edgeLabels.clear();
15110 terminalLabels.clear();
15111 }, "clear");
15112 var getLabelStyles = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .__name */ .eW)((styleArray) => {
15113 let styles = styleArray ? styleArray.reduce((acc, style) => acc + ";" + style, "") : "";
15114 return styles;
15115 }, "getLabelStyles");
15116 var insertEdgeLabel = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .__name */ .eW)(async (elem, edge) => {
15117 let useHtmlLabels = (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .evaluate */ .ku)((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .getConfig2 */ .nV)().flowchart.htmlLabels);
15118 const labelElement = await (0,_chunk_C3MQ5ANM_mjs__WEBPACK_IMPORTED_MODULE_3__/* .createText */ .rw)(elem, edge.label, {
15119 style: getLabelStyles(edge.labelStyle),
15120 useHtmlLabels,
15121 addSvgBackground: true,
15122 isNode: false
15123 });
15124 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .log */ .cM.info("abc82", edge, edge.labelType);
15125 const edgeLabel = elem.insert("g").attr("class", "edgeLabel");
15126 const label = edgeLabel.insert("g").attr("class", "label");
15127 label.node().appendChild(labelElement);
15128 let bbox = labelElement.getBBox();
15129 if (useHtmlLabels) {
15130 const div = labelElement.children[0];
15131 const dv = (0,d3__WEBPACK_IMPORTED_MODULE_6__/* .select */ .Ys)(labelElement);
15132 bbox = div.getBoundingClientRect();
15133 dv.attr("width", bbox.width);
15134 dv.attr("height", bbox.height);
15135 }
15136 label.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")");
15137 edgeLabels.set(edge.id, edgeLabel);
15138 edge.width = bbox.width;
15139 edge.height = bbox.height;
15140 let fo;
15141 if (edge.startLabelLeft) {
15142 const startLabelElement = await (0,_chunk_HRU6DDCH_mjs__WEBPACK_IMPORTED_MODULE_1__/* .createLabel_default */ .XO)(
15143 edge.startLabelLeft,
15144 getLabelStyles(edge.labelStyle)
15145 );
15146 const startEdgeLabelLeft = elem.insert("g").attr("class", "edgeTerminals");
15147 const inner = startEdgeLabelLeft.insert("g").attr("class", "inner");
15148 fo = inner.node().appendChild(startLabelElement);
15149 const slBox = startLabelElement.getBBox();
15150 inner.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")");
15151 if (!terminalLabels.get(edge.id)) {
15152 terminalLabels.set(edge.id, {});
15153 }
15154 terminalLabels.get(edge.id).startLeft = startEdgeLabelLeft;
15155 setTerminalWidth(fo, edge.startLabelLeft);
15156 }
15157 if (edge.startLabelRight) {
15158 const startLabelElement = await (0,_chunk_HRU6DDCH_mjs__WEBPACK_IMPORTED_MODULE_1__/* .createLabel_default */ .XO)(
15159 edge.startLabelRight,
15160 getLabelStyles(edge.labelStyle)
15161 );
15162 const startEdgeLabelRight = elem.insert("g").attr("class", "edgeTerminals");
15163 const inner = startEdgeLabelRight.insert("g").attr("class", "inner");
15164 fo = startEdgeLabelRight.node().appendChild(startLabelElement);
15165 inner.node().appendChild(startLabelElement);
15166 const slBox = startLabelElement.getBBox();
15167 inner.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")");
15168 if (!terminalLabels.get(edge.id)) {
15169 terminalLabels.set(edge.id, {});
15170 }
15171 terminalLabels.get(edge.id).startRight = startEdgeLabelRight;
15172 setTerminalWidth(fo, edge.startLabelRight);
15173 }
15174 if (edge.endLabelLeft) {
15175 const endLabelElement = await (0,_chunk_HRU6DDCH_mjs__WEBPACK_IMPORTED_MODULE_1__/* .createLabel_default */ .XO)(edge.endLabelLeft, getLabelStyles(edge.labelStyle));
15176 const endEdgeLabelLeft = elem.insert("g").attr("class", "edgeTerminals");
15177 const inner = endEdgeLabelLeft.insert("g").attr("class", "inner");
15178 fo = inner.node().appendChild(endLabelElement);
15179 const slBox = endLabelElement.getBBox();
15180 inner.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")");
15181 endEdgeLabelLeft.node().appendChild(endLabelElement);
15182 if (!terminalLabels.get(edge.id)) {
15183 terminalLabels.set(edge.id, {});
15184 }
15185 terminalLabels.get(edge.id).endLeft = endEdgeLabelLeft;
15186 setTerminalWidth(fo, edge.endLabelLeft);
15187 }
15188 if (edge.endLabelRight) {
15189 const endLabelElement = await (0,_chunk_HRU6DDCH_mjs__WEBPACK_IMPORTED_MODULE_1__/* .createLabel_default */ .XO)(edge.endLabelRight, getLabelStyles(edge.labelStyle));
15190 const endEdgeLabelRight = elem.insert("g").attr("class", "edgeTerminals");
15191 const inner = endEdgeLabelRight.insert("g").attr("class", "inner");
15192 fo = inner.node().appendChild(endLabelElement);
15193 const slBox = endLabelElement.getBBox();
15194 inner.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")");
15195 endEdgeLabelRight.node().appendChild(endLabelElement);
15196 if (!terminalLabels.get(edge.id)) {
15197 terminalLabels.set(edge.id, {});
15198 }
15199 terminalLabels.get(edge.id).endRight = endEdgeLabelRight;
15200 setTerminalWidth(fo, edge.endLabelRight);
15201 }
15202 return labelElement;
15203 }, "insertEdgeLabel");
15204 function setTerminalWidth(fo, value) {
15205 if ((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .getConfig2 */ .nV)().flowchart.htmlLabels && fo) {
15206 fo.style.width = value.length * 9 + "px";
15207 fo.style.height = "12px";
15208 }
15209 }
15210 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .__name */ .eW)(setTerminalWidth, "setTerminalWidth");
15211 var positionEdgeLabel = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .__name */ .eW)((edge, paths) => {
15212 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .log */ .cM.debug("Moving label abc88 ", edge.id, edge.label, edgeLabels.get(edge.id), paths);
15213 let path = paths.updatedPath ? paths.updatedPath : paths.originalPath;
15214 const siteConfig = (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .getConfig2 */ .nV)();
15215 const { subGraphTitleTotalMargin } = (0,_chunk_K557N5IZ_mjs__WEBPACK_IMPORTED_MODULE_2__/* .getSubGraphTitleMargins */ .L)(siteConfig);
15216 if (edge.label) {
15217 const el = edgeLabels.get(edge.id);
15218 let x = edge.x;
15219 let y = edge.y;
15220 if (path) {
15221 const pos = _chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .utils_default */ .w8.calcLabelPosition(path);
15222 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .log */ .cM.debug(
15223 "Moving label " + edge.label + " from (",
15224 x,
15225 ",",
15226 y,
15227 ") to (",
15228 pos.x,
15229 ",",
15230 pos.y,
15231 ") abc88"
15232 );
15233 if (paths.updatedPath) {
15234 x = pos.x;
15235 y = pos.y;
15236 }
15237 }
15238 el.attr("transform", `translate(${x}, ${y + subGraphTitleTotalMargin / 2})`);
15239 }
15240 if (edge.startLabelLeft) {
15241 const el = terminalLabels.get(edge.id).startLeft;
15242 let x = edge.x;
15243 let y = edge.y;
15244 if (path) {
15245 const pos = _chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .utils_default */ .w8.calcTerminalLabelPosition(edge.arrowTypeStart ? 10 : 0, "start_left", path);
15246 x = pos.x;
15247 y = pos.y;
15248 }
15249 el.attr("transform", `translate(${x}, ${y})`);
15250 }
15251 if (edge.startLabelRight) {
15252 const el = terminalLabels.get(edge.id).startRight;
15253 let x = edge.x;
15254 let y = edge.y;
15255 if (path) {
15256 const pos = _chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .utils_default */ .w8.calcTerminalLabelPosition(
15257 edge.arrowTypeStart ? 10 : 0,
15258 "start_right",
15259 path
15260 );
15261 x = pos.x;
15262 y = pos.y;
15263 }
15264 el.attr("transform", `translate(${x}, ${y})`);
15265 }
15266 if (edge.endLabelLeft) {
15267 const el = terminalLabels.get(edge.id).endLeft;
15268 let x = edge.x;
15269 let y = edge.y;
15270 if (path) {
15271 const pos = _chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .utils_default */ .w8.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, "end_left", path);
15272 x = pos.x;
15273 y = pos.y;
15274 }
15275 el.attr("transform", `translate(${x}, ${y})`);
15276 }
15277 if (edge.endLabelRight) {
15278 const el = terminalLabels.get(edge.id).endRight;
15279 let x = edge.x;
15280 let y = edge.y;
15281 if (path) {
15282 const pos = _chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .utils_default */ .w8.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, "end_right", path);
15283 x = pos.x;
15284 y = pos.y;
15285 }
15286 el.attr("transform", `translate(${x}, ${y})`);
15287 }
15288 }, "positionEdgeLabel");
15289 var outsideNode = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .__name */ .eW)((node, point2) => {
15290 const x = node.x;
15291 const y = node.y;
15292 const dx = Math.abs(point2.x - x);
15293 const dy = Math.abs(point2.y - y);
15294 const w = node.width / 2;
15295 const h = node.height / 2;
15296 return dx >= w || dy >= h;
15297 }, "outsideNode");
15298 var intersection = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .__name */ .eW)((node, outsidePoint, insidePoint) => {
15299 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .log */ .cM.debug(`intersection calc abc89:
15300 outsidePoint: ${JSON.stringify(outsidePoint)}
15301 insidePoint : ${JSON.stringify(insidePoint)}
15302 node : x:${node.x} y:${node.y} w:${node.width} h:${node.height}`);
15303 const x = node.x;
15304 const y = node.y;
15305 const dx = Math.abs(x - insidePoint.x);
15306 const w = node.width / 2;
15307 let r = insidePoint.x < outsidePoint.x ? w - dx : w + dx;
15308 const h = node.height / 2;
15309 const Q = Math.abs(outsidePoint.y - insidePoint.y);
15310 const R = Math.abs(outsidePoint.x - insidePoint.x);
15311 if (Math.abs(y - outsidePoint.y) * w > Math.abs(x - outsidePoint.x) * h) {
15312 let q = insidePoint.y < outsidePoint.y ? outsidePoint.y - h - y : y - h - outsidePoint.y;
15313 r = R * q / Q;
15314 const res = {
15315 x: insidePoint.x < outsidePoint.x ? insidePoint.x + r : insidePoint.x - R + r,
15316 y: insidePoint.y < outsidePoint.y ? insidePoint.y + Q - q : insidePoint.y - Q + q
15317 };
15318 if (r === 0) {
15319 res.x = outsidePoint.x;
15320 res.y = outsidePoint.y;
15321 }
15322 if (R === 0) {
15323 res.x = outsidePoint.x;
15324 }
15325 if (Q === 0) {
15326 res.y = outsidePoint.y;
15327 }
15328 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .log */ .cM.debug(`abc89 top/bottom calc, Q ${Q}, q ${q}, R ${R}, r ${r}`, res);
15329 return res;
15330 } else {
15331 if (insidePoint.x < outsidePoint.x) {
15332 r = outsidePoint.x - w - x;
15333 } else {
15334 r = x - w - outsidePoint.x;
15335 }
15336 let q = Q * r / R;
15337 let _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R - r : insidePoint.x - R + r;
15338 let _y = insidePoint.y < outsidePoint.y ? insidePoint.y + q : insidePoint.y - q;
15339 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .log */ .cM.debug(`sides calc abc89, Q ${Q}, q ${q}, R ${R}, r ${r}`, { _x, _y });
15340 if (r === 0) {
15341 _x = outsidePoint.x;
15342 _y = outsidePoint.y;
15343 }
15344 if (R === 0) {
15345 _x = outsidePoint.x;
15346 }
15347 if (Q === 0) {
15348 _y = outsidePoint.y;
15349 }
15350 return { x: _x, y: _y };
15351 }
15352 }, "intersection");
15353 var cutPathAtIntersect = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .__name */ .eW)((_points, boundaryNode) => {
15354 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .log */ .cM.warn("abc88 cutPathAtIntersect", _points, boundaryNode);
15355 let points = [];
15356 let lastPointOutside = _points[0];
15357 let isInside = false;
15358 _points.forEach((point2) => {
15359 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .log */ .cM.info("abc88 checking point", point2, boundaryNode);
15360 if (!outsideNode(boundaryNode, point2) && !isInside) {
15361 const inter = intersection(boundaryNode, lastPointOutside, point2);
15362 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .log */ .cM.debug("abc88 inside", point2, lastPointOutside, inter);
15363 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .log */ .cM.debug("abc88 intersection", inter, boundaryNode);
15364 let pointPresent = false;
15365 points.forEach((p) => {
15366 pointPresent = pointPresent || p.x === inter.x && p.y === inter.y;
15367 });
15368 if (!points.some((e) => e.x === inter.x && e.y === inter.y)) {
15369 points.push(inter);
15370 } else {
15371 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .log */ .cM.warn("abc88 no intersect", inter, points);
15372 }
15373 isInside = true;
15374 } else {
15375 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .log */ .cM.warn("abc88 outside", point2, lastPointOutside);
15376 lastPointOutside = point2;
15377 if (!isInside) {
15378 points.push(point2);
15379 }
15380 }
15381 });
15382 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .log */ .cM.debug("returning points", points);
15383 return points;
15384 }, "cutPathAtIntersect");
15385 function extractCornerPoints(points) {
15386 const cornerPoints = [];
15387 const cornerPointPositions = [];
15388 for (let i = 1; i < points.length - 1; i++) {
15389 const prev = points[i - 1];
15390 const curr = points[i];
15391 const next = points[i + 1];
15392 if (prev.x === curr.x && curr.y === next.y && Math.abs(curr.x - next.x) > 5 && Math.abs(curr.y - prev.y) > 5) {
15393 cornerPoints.push(curr);
15394 cornerPointPositions.push(i);
15395 } else if (prev.y === curr.y && curr.x === next.x && Math.abs(curr.x - prev.x) > 5 && Math.abs(curr.y - next.y) > 5) {
15396 cornerPoints.push(curr);
15397 cornerPointPositions.push(i);
15398 }
15399 }
15400 return { cornerPoints, cornerPointPositions };
15401 }
15402 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .__name */ .eW)(extractCornerPoints, "extractCornerPoints");
15403 var findAdjacentPoint = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .__name */ .eW)(function(pointA, pointB, distance) {
15404 const xDiff = pointB.x - pointA.x;
15405 const yDiff = pointB.y - pointA.y;
15406 const length = Math.sqrt(xDiff * xDiff + yDiff * yDiff);
15407 const ratio = distance / length;
15408 return { x: pointB.x - ratio * xDiff, y: pointB.y - ratio * yDiff };
15409 }, "findAdjacentPoint");
15410 var fixCorners = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .__name */ .eW)(function(lineData) {
15411 const { cornerPointPositions } = extractCornerPoints(lineData);
15412 const newLineData = [];
15413 for (let i = 0; i < lineData.length; i++) {
15414 if (cornerPointPositions.includes(i)) {
15415 const prevPoint = lineData[i - 1];
15416 const nextPoint = lineData[i + 1];
15417 const cornerPoint = lineData[i];
15418 const newPrevPoint = findAdjacentPoint(prevPoint, cornerPoint, 5);
15419 const newNextPoint = findAdjacentPoint(nextPoint, cornerPoint, 5);
15420 const xDiff = newNextPoint.x - newPrevPoint.x;
15421 const yDiff = newNextPoint.y - newPrevPoint.y;
15422 newLineData.push(newPrevPoint);
15423 const a = Math.sqrt(2) * 2;
15424 let newCornerPoint = { x: cornerPoint.x, y: cornerPoint.y };
15425 if (Math.abs(nextPoint.x - prevPoint.x) > 10 && Math.abs(nextPoint.y - prevPoint.y) >= 10) {
15426 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .log */ .cM.debug(
15427 "Corner point fixing",
15428 Math.abs(nextPoint.x - prevPoint.x),
15429 Math.abs(nextPoint.y - prevPoint.y)
15430 );
15431 const r = 5;
15432 if (cornerPoint.x === newPrevPoint.x) {
15433 newCornerPoint = {
15434 x: xDiff < 0 ? newPrevPoint.x - r + a : newPrevPoint.x + r - a,
15435 y: yDiff < 0 ? newPrevPoint.y - a : newPrevPoint.y + a
15436 };
15437 } else {
15438 newCornerPoint = {
15439 x: xDiff < 0 ? newPrevPoint.x - a : newPrevPoint.x + a,
15440 y: yDiff < 0 ? newPrevPoint.y - r + a : newPrevPoint.y + r - a
15441 };
15442 }
15443 } else {
15444 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .log */ .cM.debug(
15445 "Corner point skipping fixing",
15446 Math.abs(nextPoint.x - prevPoint.x),
15447 Math.abs(nextPoint.y - prevPoint.y)
15448 );
15449 }
15450 newLineData.push(newCornerPoint, newNextPoint);
15451 } else {
15452 newLineData.push(lineData[i]);
15453 }
15454 }
15455 return newLineData;
15456 }, "fixCorners");
15457 var insertEdge = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .__name */ .eW)(function(elem, edge, clusterDb, diagramType, startNode, endNode, id) {
15458 const { handDrawnSeed } = (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .getConfig2 */ .nV)();
15459 let points = edge.points;
15460 let pointsHasChanged = false;
15461 const tail = startNode;
15462 var head = endNode;
15463 const edgeClassStyles = [];
15464 for (const key in edge.cssCompiledStyles) {
15465 if ((0,_chunk_HRU6DDCH_mjs__WEBPACK_IMPORTED_MODULE_1__/* .isLabelStyle */ .Fh)(key)) {
15466 continue;
15467 }
15468 edgeClassStyles.push(edge.cssCompiledStyles[key]);
15469 }
15470 if (head.intersect && tail.intersect) {
15471 points = points.slice(1, edge.points.length - 1);
15472 points.unshift(tail.intersect(points[0]));
15473 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .log */ .cM.debug(
15474 "Last point APA12",
15475 edge.start,
15476 "-->",
15477 edge.end,
15478 points[points.length - 1],
15479 head,
15480 head.intersect(points[points.length - 1])
15481 );
15482 points.push(head.intersect(points[points.length - 1]));
15483 }
15484 if (edge.toCluster) {
15485 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .log */ .cM.info("to cluster abc88", clusterDb.get(edge.toCluster));
15486 points = cutPathAtIntersect(edge.points, clusterDb.get(edge.toCluster).node);
15487 pointsHasChanged = true;
15488 }
15489 if (edge.fromCluster) {
15490 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .log */ .cM.debug(
15491 "from cluster abc88",
15492 clusterDb.get(edge.fromCluster),
15493 JSON.stringify(points, null, 2)
15494 );
15495 points = cutPathAtIntersect(points.reverse(), clusterDb.get(edge.fromCluster).node).reverse();
15496 pointsHasChanged = true;
15497 }
15498 let lineData = points.filter((p) => !Number.isNaN(p.y));
15499 lineData = fixCorners(lineData);
15500 let curve = d3__WEBPACK_IMPORTED_MODULE_6__/* .curveBasis */ .$0Z;
15501 curve = d3__WEBPACK_IMPORTED_MODULE_6__/* .curveLinear */ .c_6;
15502 switch (edge.curve) {
15503 case "linear":
15504 curve = d3__WEBPACK_IMPORTED_MODULE_6__/* .curveLinear */ .c_6;
15505 break;
15506 case "basis":
15507 curve = d3__WEBPACK_IMPORTED_MODULE_6__/* .curveBasis */ .$0Z;
15508 break;
15509 case "cardinal":
15510 curve = d3__WEBPACK_IMPORTED_MODULE_6__/* .curveCardinal */ .YY7;
15511 break;
15512 case "bumpX":
15513 curve = d3__WEBPACK_IMPORTED_MODULE_6__/* .curveBumpX */ .qpX;
15514 break;
15515 case "bumpY":
15516 curve = d3__WEBPACK_IMPORTED_MODULE_6__/* .curveBumpY */ .u93;
15517 break;
15518 case "catmullRom":
15519 curve = d3__WEBPACK_IMPORTED_MODULE_6__/* .curveCatmullRom */ .zgE;
15520 break;
15521 case "monotoneX":
15522 curve = d3__WEBPACK_IMPORTED_MODULE_6__/* .curveMonotoneX */ .FdL;
15523 break;
15524 case "monotoneY":
15525 curve = d3__WEBPACK_IMPORTED_MODULE_6__/* .curveMonotoneY */ .ak_;
15526 break;
15527 case "natural":
15528 curve = d3__WEBPACK_IMPORTED_MODULE_6__/* .curveNatural */ .SxZ;
15529 break;
15530 case "step":
15531 curve = d3__WEBPACK_IMPORTED_MODULE_6__/* .curveStep */ .eA_;
15532 break;
15533 case "stepAfter":
15534 curve = d3__WEBPACK_IMPORTED_MODULE_6__/* .curveStepAfter */ .jsv;
15535 break;
15536 case "stepBefore":
15537 curve = d3__WEBPACK_IMPORTED_MODULE_6__/* .curveStepBefore */ .iJ;
15538 break;
15539 default:
15540 curve = d3__WEBPACK_IMPORTED_MODULE_6__/* .curveBasis */ .$0Z;
15541 }
15542 const { x, y } = (0,_chunk_VV3M67IP_mjs__WEBPACK_IMPORTED_MODULE_0__/* .getLineFunctionsWithOffset */ .o)(edge);
15543 const lineFunction = (0,d3__WEBPACK_IMPORTED_MODULE_6__/* .line */ .jvg)().x(x).y(y).curve(curve);
15544 let strokeClasses;
15545 switch (edge.thickness) {
15546 case "normal":
15547 strokeClasses = "edge-thickness-normal";
15548 break;
15549 case "thick":
15550 strokeClasses = "edge-thickness-thick";
15551 break;
15552 case "invisible":
15553 strokeClasses = "edge-thickness-invisible";
15554 break;
15555 default:
15556 strokeClasses = "edge-thickness-normal";
15557 }
15558 switch (edge.pattern) {
15559 case "solid":
15560 strokeClasses += " edge-pattern-solid";
15561 break;
15562 case "dotted":
15563 strokeClasses += " edge-pattern-dotted";
15564 break;
15565 case "dashed":
15566 strokeClasses += " edge-pattern-dashed";
15567 break;
15568 default:
15569 strokeClasses += " edge-pattern-solid";
15570 }
15571 let svgPath;
15572 let linePath = lineFunction(lineData);
15573 const edgeStyles = Array.isArray(edge.style) ? edge.style : [edge.style];
15574 let strokeColor = edgeStyles.find((style) => style?.startsWith("stroke:"));
15575 if (edge.look === "handDrawn") {
15576 const rc = roughjs__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z.svg(elem);
15577 Object.assign([], lineData);
15578 const svgPathNode = rc.path(linePath, {
15579 roughness: 0.3,
15580 seed: handDrawnSeed
15581 });
15582 strokeClasses += " transition";
15583 svgPath = (0,d3__WEBPACK_IMPORTED_MODULE_6__/* .select */ .Ys)(svgPathNode).select("path").attr("id", edge.id).attr("class", " " + strokeClasses + (edge.classes ? " " + edge.classes : "")).attr("style", edgeStyles ? edgeStyles.reduce((acc, style) => acc + ";" + style, "") : "");
15584 let d = svgPath.attr("d");
15585 svgPath.attr("d", d);
15586 elem.node().appendChild(svgPath.node());
15587 } else {
15588 const stylesFromClasses = edgeClassStyles.join(";");
15589 const styles = edgeStyles ? edgeStyles.reduce((acc, style) => acc + style + ";", "") : "";
15590 let animationClass = "";
15591 if (edge.animate) {
15592 animationClass = " edge-animation-fast";
15593 }
15594 if (edge.animation) {
15595 animationClass = " edge-animation-" + edge.animation;
15596 }
15597 const pathStyle = stylesFromClasses ? stylesFromClasses + ";" + styles + ";" : styles;
15598 svgPath = elem.append("path").attr("d", linePath).attr("id", edge.id).attr(
15599 "class",
15600 " " + strokeClasses + (edge.classes ? " " + edge.classes : "") + (animationClass ?? "")
15601 ).attr("style", pathStyle);
15602 strokeColor = pathStyle.match(/stroke:([^;]+)/)?.[1];
15603 }
15604 let url = "";
15605 if ((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .getConfig2 */ .nV)().flowchart.arrowMarkerAbsolute || (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .getConfig2 */ .nV)().state.arrowMarkerAbsolute) {
15606 url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search;
15607 url = url.replace(/\(/g, "\\(").replace(/\)/g, "\\)");
15608 }
15609 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .log */ .cM.info("arrowTypeStart", edge.arrowTypeStart);
15610 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .log */ .cM.info("arrowTypeEnd", edge.arrowTypeEnd);
15611 addEdgeMarkers(svgPath, edge, url, id, diagramType, strokeColor);
15612 let paths = {};
15613 if (pointsHasChanged) {
15614 paths.updatedPath = points;
15615 }
15616 paths.originalPath = edge.points;
15617 return paths;
15618 }, "insertEdge");
15619
15620 // src/rendering-util/rendering-elements/markers.js
15621 var insertMarkers = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .__name */ .eW)((elem, markerArray, type, id) => {
15622 markerArray.forEach((markerName) => {
15623 markers[markerName](elem, type, id);
15624 });
15625 }, "insertMarkers");
15626 var extension = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .__name */ .eW)((elem, type, id) => {
15627 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .log */ .cM.trace("Making markers for ", id);
15628 elem.append("defs").append("marker").attr("id", id + "_" + type + "-extensionStart").attr("class", "marker extension " + type).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z");
15629 elem.append("defs").append("marker").attr("id", id + "_" + type + "-extensionEnd").attr("class", "marker extension " + type).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z");
15630 }, "extension");
15631 var composition = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .__name */ .eW)((elem, type, id) => {
15632 elem.append("defs").append("marker").attr("id", id + "_" + type + "-compositionStart").attr("class", "marker composition " + type).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
15633 elem.append("defs").append("marker").attr("id", id + "_" + type + "-compositionEnd").attr("class", "marker composition " + type).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
15634 }, "composition");
15635 var aggregation = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .__name */ .eW)((elem, type, id) => {
15636 elem.append("defs").append("marker").attr("id", id + "_" + type + "-aggregationStart").attr("class", "marker aggregation " + type).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
15637 elem.append("defs").append("marker").attr("id", id + "_" + type + "-aggregationEnd").attr("class", "marker aggregation " + type).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
15638 }, "aggregation");
15639 var dependency = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .__name */ .eW)((elem, type, id) => {
15640 elem.append("defs").append("marker").attr("id", id + "_" + type + "-dependencyStart").attr("class", "marker dependency " + type).attr("refX", 6).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z");
15641 elem.append("defs").append("marker").attr("id", id + "_" + type + "-dependencyEnd").attr("class", "marker dependency " + type).attr("refX", 13).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
15642 }, "dependency");
15643 var lollipop = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .__name */ .eW)((elem, type, id) => {
15644 elem.append("defs").append("marker").attr("id", id + "_" + type + "-lollipopStart").attr("class", "marker lollipop " + type).attr("refX", 13).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6);
15645 elem.append("defs").append("marker").attr("id", id + "_" + type + "-lollipopEnd").attr("class", "marker lollipop " + type).attr("refX", 1).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6);
15646 }, "lollipop");
15647 var point = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .__name */ .eW)((elem, type, id) => {
15648 elem.append("marker").attr("id", id + "_" + type + "-pointEnd").attr("class", "marker " + type).attr("viewBox", "0 0 10 10").attr("refX", 5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 8).attr("markerHeight", 8).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
15649 elem.append("marker").attr("id", id + "_" + type + "-pointStart").attr("class", "marker " + type).attr("viewBox", "0 0 10 10").attr("refX", 4.5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 8).attr("markerHeight", 8).attr("orient", "auto").append("path").attr("d", "M 0 5 L 10 10 L 10 0 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
15650 }, "point");
15651 var circle = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .__name */ .eW)((elem, type, id) => {
15652 elem.append("marker").attr("id", id + "_" + type + "-circleEnd").attr("class", "marker " + type).attr("viewBox", "0 0 10 10").attr("refX", 11).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
15653 elem.append("marker").attr("id", id + "_" + type + "-circleStart").attr("class", "marker " + type).attr("viewBox", "0 0 10 10").attr("refX", -1).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
15654 }, "circle");
15655 var cross = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .__name */ .eW)((elem, type, id) => {
15656 elem.append("marker").attr("id", id + "_" + type + "-crossEnd").attr("class", "marker cross " + type).attr("viewBox", "0 0 11 11").attr("refX", 12).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0");
15657 elem.append("marker").attr("id", id + "_" + type + "-crossStart").attr("class", "marker cross " + type).attr("viewBox", "0 0 11 11").attr("refX", -1).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0");
15658 }, "cross");
15659 var barb = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .__name */ .eW)((elem, type, id) => {
15660 elem.append("defs").append("marker").attr("id", id + "_" + type + "-barbEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "userSpaceOnUse").attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z");
15661 }, "barb");
15662 var only_one = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .__name */ .eW)((elem, type, id) => {
15663 elem.append("defs").append("marker").attr("id", id + "_" + type + "-onlyOneStart").attr("class", "marker onlyOne " + type).attr("refX", 0).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").append("path").attr("d", "M9,0 L9,18 M15,0 L15,18");
15664 elem.append("defs").append("marker").attr("id", id + "_" + type + "-onlyOneEnd").attr("class", "marker onlyOne " + type).attr("refX", 18).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").append("path").attr("d", "M3,0 L3,18 M9,0 L9,18");
15665 }, "only_one");
15666 var zero_or_one = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .__name */ .eW)((elem, type, id) => {
15667 const startMarker = elem.append("defs").append("marker").attr("id", id + "_" + type + "-zeroOrOneStart").attr("class", "marker zeroOrOne " + type).attr("refX", 0).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("orient", "auto");
15668 startMarker.append("circle").attr("fill", "white").attr("cx", 21).attr("cy", 9).attr("r", 6);
15669 startMarker.append("path").attr("d", "M9,0 L9,18");
15670 const endMarker = elem.append("defs").append("marker").attr("id", id + "_" + type + "-zeroOrOneEnd").attr("class", "marker zeroOrOne " + type).attr("refX", 30).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("orient", "auto");
15671 endMarker.append("circle").attr("fill", "white").attr("cx", 9).attr("cy", 9).attr("r", 6);
15672 endMarker.append("path").attr("d", "M21,0 L21,18");
15673 }, "zero_or_one");
15674 var one_or_more = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .__name */ .eW)((elem, type, id) => {
15675 elem.append("defs").append("marker").attr("id", id + "_" + type + "-oneOrMoreStart").attr("class", "marker oneOrMore " + type).attr("refX", 18).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("orient", "auto").append("path").attr("d", "M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27");
15676 elem.append("defs").append("marker").attr("id", id + "_" + type + "-oneOrMoreEnd").attr("class", "marker oneOrMore " + type).attr("refX", 27).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("orient", "auto").append("path").attr("d", "M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18");
15677 }, "one_or_more");
15678 var zero_or_more = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .__name */ .eW)((elem, type, id) => {
15679 const startMarker = elem.append("defs").append("marker").attr("id", id + "_" + type + "-zeroOrMoreStart").attr("class", "marker zeroOrMore " + type).attr("refX", 18).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("orient", "auto");
15680 startMarker.append("circle").attr("fill", "white").attr("cx", 48).attr("cy", 18).attr("r", 6);
15681 startMarker.append("path").attr("d", "M0,18 Q18,0 36,18 Q18,36 0,18");
15682 const endMarker = elem.append("defs").append("marker").attr("id", id + "_" + type + "-zeroOrMoreEnd").attr("class", "marker zeroOrMore " + type).attr("refX", 39).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("orient", "auto");
15683 endMarker.append("circle").attr("fill", "white").attr("cx", 9).attr("cy", 18).attr("r", 6);
15684 endMarker.append("path").attr("d", "M21,18 Q39,0 57,18 Q39,36 21,18");
15685 }, "zero_or_more");
15686 var requirement_arrow = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .__name */ .eW)((elem, type, id) => {
15687 elem.append("defs").append("marker").attr("id", id + "_" + type + "-requirement_arrowEnd").attr("refX", 20).attr("refY", 10).attr("markerWidth", 20).attr("markerHeight", 20).attr("orient", "auto").append("path").attr(
15688 "d",
15689 `M0,0
15690 L20,10
15691 M20,10
15692 L0,20`
15693 );
15694 }, "requirement_arrow");
15695 var requirement_contains = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_5__/* .__name */ .eW)((elem, type, id) => {
15696 const containsNode = elem.append("defs").append("marker").attr("id", id + "_" + type + "-requirement_containsStart").attr("refX", 0).attr("refY", 10).attr("markerWidth", 20).attr("markerHeight", 20).attr("orient", "auto").append("g");
15697 containsNode.append("circle").attr("cx", 10).attr("cy", 10).attr("r", 9).attr("fill", "none");
15698 containsNode.append("line").attr("x1", 1).attr("x2", 19).attr("y1", 10).attr("y2", 10);
15699 containsNode.append("line").attr("y1", 1).attr("y2", 19).attr("x1", 10).attr("x2", 10);
15700 }, "requirement_contains");
15701 var markers = {
15702 extension,
15703 composition,
15704 aggregation,
15705 dependency,
15706 lollipop,
15707 point,
15708 circle,
15709 cross,
15710 barb,
15711 only_one,
15712 zero_or_one,
15713 one_or_more,
15714 zero_or_more,
15715 requirement_arrow,
15716 requirement_contains
15717 };
15718 var markers_default = insertMarkers;
15719
15720
15721
15722
15723 /***/ }),
15724
15725 /***/ 81861:
15726 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
15727
15728 "use strict";
15729 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
15730 /* harmony export */ L: () => (/* binding */ getSubGraphTitleMargins)
15731 /* harmony export */ });
15732 /* harmony import */ var _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(86906);
15733
15734
15735 // src/utils/subGraphTitleMargins.ts
15736 var getSubGraphTitleMargins = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(({
15737 flowchart
15738 }) => {
15739 const subGraphTitleTopMargin = flowchart?.subGraphTitleMargin?.top ?? 0;
15740 const subGraphTitleBottomMargin = flowchart?.subGraphTitleMargin?.bottom ?? 0;
15741 const subGraphTitleTotalMargin = subGraphTitleTopMargin + subGraphTitleBottomMargin;
15742 return {
15743 subGraphTitleTopMargin,
15744 subGraphTitleBottomMargin,
15745 subGraphTitleTotalMargin
15746 };
15747 }, "getSubGraphTitleMargins");
15748
15749
15750
15751
15752 /***/ }),
15753
15754 /***/ 42626:
15755 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
15756
15757 "use strict";
15758 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
15759 /* harmony export */ $m: () => (/* binding */ ZERO_WIDTH_SPACE),
15760 /* harmony export */ Cq: () => (/* binding */ calculateTextWidth),
15761 /* harmony export */ Ln: () => (/* binding */ getEdgeId),
15762 /* harmony export */ MX: () => (/* binding */ random),
15763 /* harmony export */ Ox: () => (/* binding */ generateId),
15764 /* harmony export */ R7: () => (/* binding */ handleUndefinedAttr),
15765 /* harmony export */ Rb: () => (/* binding */ cleanAndMerge),
15766 /* harmony export */ SH: () => (/* binding */ decodeEntities),
15767 /* harmony export */ VG: () => (/* binding */ parseFontSize),
15768 /* harmony export */ Vy: () => (/* binding */ encodeEntities),
15769 /* harmony export */ X4: () => (/* binding */ wrapLabel),
15770 /* harmony export */ XD: () => (/* binding */ calculateTextHeight),
15771 /* harmony export */ bZ: () => (/* binding */ isDetailedError),
15772 /* harmony export */ be: () => (/* binding */ getStylesFromArray),
15773 /* harmony export */ le: () => (/* binding */ interpolateToCurve),
15774 /* harmony export */ tf: () => (/* binding */ removeDirectives),
15775 /* harmony export */ w8: () => (/* binding */ utils_default)
15776 /* harmony export */ });
15777 /* harmony import */ var _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(86906);
15778 /* harmony import */ var _braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7608);
15779 /* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(83619);
15780 /* harmony import */ var lodash_es_memoize_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(86861);
15781 /* harmony import */ var lodash_es_merge_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(20895);
15782
15783
15784 // src/utils.ts
15785
15786
15787
15788
15789 var ZERO_WIDTH_SPACE = "\u200B";
15790 var d3CurveTypes = {
15791 curveBasis: d3__WEBPACK_IMPORTED_MODULE_2__/* .curveBasis */ .$0Z,
15792 curveBasisClosed: d3__WEBPACK_IMPORTED_MODULE_2__/* .curveBasisClosed */ .Dts,
15793 curveBasisOpen: d3__WEBPACK_IMPORTED_MODULE_2__/* .curveBasisOpen */ .WQY,
15794 curveBumpX: d3__WEBPACK_IMPORTED_MODULE_2__/* .curveBumpX */ .qpX,
15795 curveBumpY: d3__WEBPACK_IMPORTED_MODULE_2__/* .curveBumpY */ .u93,
15796 curveBundle: d3__WEBPACK_IMPORTED_MODULE_2__/* .curveBundle */ .tFB,
15797 curveCardinalClosed: d3__WEBPACK_IMPORTED_MODULE_2__/* .curveCardinalClosed */ .OvA,
15798 curveCardinalOpen: d3__WEBPACK_IMPORTED_MODULE_2__/* .curveCardinalOpen */ .dCK,
15799 curveCardinal: d3__WEBPACK_IMPORTED_MODULE_2__/* .curveCardinal */ .YY7,
15800 curveCatmullRomClosed: d3__WEBPACK_IMPORTED_MODULE_2__/* .curveCatmullRomClosed */ .fGX,
15801 curveCatmullRomOpen: d3__WEBPACK_IMPORTED_MODULE_2__/* .curveCatmullRomOpen */ .$m7,
15802 curveCatmullRom: d3__WEBPACK_IMPORTED_MODULE_2__/* .curveCatmullRom */ .zgE,
15803 curveLinear: d3__WEBPACK_IMPORTED_MODULE_2__/* .curveLinear */ .c_6,
15804 curveLinearClosed: d3__WEBPACK_IMPORTED_MODULE_2__/* .curveLinearClosed */ .fxm,
15805 curveMonotoneX: d3__WEBPACK_IMPORTED_MODULE_2__/* .curveMonotoneX */ .FdL,
15806 curveMonotoneY: d3__WEBPACK_IMPORTED_MODULE_2__/* .curveMonotoneY */ .ak_,
15807 curveNatural: d3__WEBPACK_IMPORTED_MODULE_2__/* .curveNatural */ .SxZ,
15808 curveStep: d3__WEBPACK_IMPORTED_MODULE_2__/* .curveStep */ .eA_,
15809 curveStepAfter: d3__WEBPACK_IMPORTED_MODULE_2__/* .curveStepAfter */ .jsv,
15810 curveStepBefore: d3__WEBPACK_IMPORTED_MODULE_2__/* .curveStepBefore */ .iJ
15811 };
15812 var directiveWithoutOpen = /\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi;
15813 var detectInit = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(function(text, config) {
15814 const inits = detectDirective(text, /(?:init\b)|(?:initialize\b)/);
15815 let results = {};
15816 if (Array.isArray(inits)) {
15817 const args = inits.map((init) => init.args);
15818 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .sanitizeDirective */ .NM)(args);
15819 results = (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .assignWithDepth_default */ .Yc)(results, [...args]);
15820 } else {
15821 results = inits.args;
15822 }
15823 if (!results) {
15824 return;
15825 }
15826 let type = (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .detectType */ .Vg)(text, config);
15827 const prop = "config";
15828 if (results[prop] !== void 0) {
15829 if (type === "flowchart-v2") {
15830 type = "flowchart";
15831 }
15832 results[type] = results[prop];
15833 delete results[prop];
15834 }
15835 return results;
15836 }, "detectInit");
15837 var detectDirective = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(function(text, type = null) {
15838 try {
15839 const commentWithoutDirectives = new RegExp(
15840 `[%]{2}(?![{]${directiveWithoutOpen.source})(?=[}][%]{2}).*
15841 `,
15842 "ig"
15843 );
15844 text = text.trim().replace(commentWithoutDirectives, "").replace(/'/gm, '"');
15845 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .log */ .cM.debug(
15846 `Detecting diagram directive${type !== null ? " type:" + type : ""} based on the text:${text}`
15847 );
15848 let match;
15849 const result = [];
15850 while ((match = _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .directiveRegex */ .Zn.exec(text)) !== null) {
15851 if (match.index === _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .directiveRegex */ .Zn.lastIndex) {
15852 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .directiveRegex */ .Zn.lastIndex++;
15853 }
15854 if (match && !type || type && match[1]?.match(type) || type && match[2]?.match(type)) {
15855 const type2 = match[1] ? match[1] : match[2];
15856 const args = match[3] ? match[3].trim() : match[4] ? JSON.parse(match[4].trim()) : null;
15857 result.push({ type: type2, args });
15858 }
15859 }
15860 if (result.length === 0) {
15861 return { type: text, args: null };
15862 }
15863 return result.length === 1 ? result[0] : result;
15864 } catch (error) {
15865 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .log */ .cM.error(
15866 `ERROR: ${error.message} - Unable to parse directive type: '${type}' based on the text: '${text}'`
15867 );
15868 return { type: void 0, args: null };
15869 }
15870 }, "detectDirective");
15871 var removeDirectives = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(function(text) {
15872 return text.replace(_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .directiveRegex */ .Zn, "");
15873 }, "removeDirectives");
15874 var isSubstringInArray = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(function(str, arr) {
15875 for (const [i, element] of arr.entries()) {
15876 if (element.match(str)) {
15877 return i;
15878 }
15879 }
15880 return -1;
15881 }, "isSubstringInArray");
15882 function interpolateToCurve(interpolate, defaultCurve) {
15883 if (!interpolate) {
15884 return defaultCurve;
15885 }
15886 const curveName = `curve${interpolate.charAt(0).toUpperCase() + interpolate.slice(1)}`;
15887 return d3CurveTypes[curveName] ?? defaultCurve;
15888 }
15889 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(interpolateToCurve, "interpolateToCurve");
15890 function formatUrl(linkStr, config) {
15891 const url = linkStr.trim();
15892 if (!url) {
15893 return void 0;
15894 }
15895 if (config.securityLevel !== "loose") {
15896 return (0,_braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_1__/* .sanitizeUrl */ .N)(url);
15897 }
15898 return url;
15899 }
15900 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(formatUrl, "formatUrl");
15901 var runFunc = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)((functionName, ...params) => {
15902 const arrPaths = functionName.split(".");
15903 const len = arrPaths.length - 1;
15904 const fnName = arrPaths[len];
15905 let obj = window;
15906 for (let i = 0; i < len; i++) {
15907 obj = obj[arrPaths[i]];
15908 if (!obj) {
15909 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .log */ .cM.error(`Function name: ${functionName} not found in window`);
15910 return;
15911 }
15912 }
15913 obj[fnName](...params);
15914 }, "runFunc");
15915 function distance(p1, p2) {
15916 if (!p1 || !p2) {
15917 return 0;
15918 }
15919 return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));
15920 }
15921 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(distance, "distance");
15922 function traverseEdge(points) {
15923 let prevPoint;
15924 let totalDistance = 0;
15925 points.forEach((point) => {
15926 totalDistance += distance(point, prevPoint);
15927 prevPoint = point;
15928 });
15929 const remainingDistance = totalDistance / 2;
15930 return calculatePoint(points, remainingDistance);
15931 }
15932 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(traverseEdge, "traverseEdge");
15933 function calcLabelPosition(points) {
15934 if (points.length === 1) {
15935 return points[0];
15936 }
15937 return traverseEdge(points);
15938 }
15939 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(calcLabelPosition, "calcLabelPosition");
15940 var roundNumber = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)((num, precision = 2) => {
15941 const factor = Math.pow(10, precision);
15942 return Math.round(num * factor) / factor;
15943 }, "roundNumber");
15944 var calculatePoint = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)((points, distanceToTraverse) => {
15945 let prevPoint = void 0;
15946 let remainingDistance = distanceToTraverse;
15947 for (const point of points) {
15948 if (prevPoint) {
15949 const vectorDistance = distance(point, prevPoint);
15950 if (vectorDistance === 0) {
15951 return prevPoint;
15952 }
15953 if (vectorDistance < remainingDistance) {
15954 remainingDistance -= vectorDistance;
15955 } else {
15956 const distanceRatio = remainingDistance / vectorDistance;
15957 if (distanceRatio <= 0) {
15958 return prevPoint;
15959 }
15960 if (distanceRatio >= 1) {
15961 return { x: point.x, y: point.y };
15962 }
15963 if (distanceRatio > 0 && distanceRatio < 1) {
15964 return {
15965 x: roundNumber((1 - distanceRatio) * prevPoint.x + distanceRatio * point.x, 5),
15966 y: roundNumber((1 - distanceRatio) * prevPoint.y + distanceRatio * point.y, 5)
15967 };
15968 }
15969 }
15970 }
15971 prevPoint = point;
15972 }
15973 throw new Error("Could not find a suitable point for the given distance");
15974 }, "calculatePoint");
15975 var calcCardinalityPosition = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)((isRelationTypePresent, points, initialPosition) => {
15976 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .log */ .cM.info(`our points ${JSON.stringify(points)}`);
15977 if (points[0] !== initialPosition) {
15978 points = points.reverse();
15979 }
15980 const distanceToCardinalityPoint = 25;
15981 const center = calculatePoint(points, distanceToCardinalityPoint);
15982 const d = isRelationTypePresent ? 10 : 5;
15983 const angle = Math.atan2(points[0].y - center.y, points[0].x - center.x);
15984 const cardinalityPosition = { x: 0, y: 0 };
15985 cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2;
15986 cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2;
15987 return cardinalityPosition;
15988 }, "calcCardinalityPosition");
15989 function calcTerminalLabelPosition(terminalMarkerSize, position, _points) {
15990 const points = structuredClone(_points);
15991 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .log */ .cM.info("our points", points);
15992 if (position !== "start_left" && position !== "start_right") {
15993 points.reverse();
15994 }
15995 const distanceToCardinalityPoint = 25 + terminalMarkerSize;
15996 const center = calculatePoint(points, distanceToCardinalityPoint);
15997 const d = 10 + terminalMarkerSize * 0.5;
15998 const angle = Math.atan2(points[0].y - center.y, points[0].x - center.x);
15999 const cardinalityPosition = { x: 0, y: 0 };
16000 if (position === "start_left") {
16001 cardinalityPosition.x = Math.sin(angle + Math.PI) * d + (points[0].x + center.x) / 2;
16002 cardinalityPosition.y = -Math.cos(angle + Math.PI) * d + (points[0].y + center.y) / 2;
16003 } else if (position === "end_right") {
16004 cardinalityPosition.x = Math.sin(angle - Math.PI) * d + (points[0].x + center.x) / 2 - 5;
16005 cardinalityPosition.y = -Math.cos(angle - Math.PI) * d + (points[0].y + center.y) / 2 - 5;
16006 } else if (position === "end_left") {
16007 cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2 - 5;
16008 cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2 - 5;
16009 } else {
16010 cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2;
16011 cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2;
16012 }
16013 return cardinalityPosition;
16014 }
16015 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(calcTerminalLabelPosition, "calcTerminalLabelPosition");
16016 function getStylesFromArray(arr) {
16017 let style = "";
16018 let labelStyle = "";
16019 for (const element of arr) {
16020 if (element !== void 0) {
16021 if (element.startsWith("color:") || element.startsWith("text-align:")) {
16022 labelStyle = labelStyle + element + ";";
16023 } else {
16024 style = style + element + ";";
16025 }
16026 }
16027 }
16028 return { style, labelStyle };
16029 }
16030 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(getStylesFromArray, "getStylesFromArray");
16031 var cnt = 0;
16032 var generateId = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(() => {
16033 cnt++;
16034 return "id-" + Math.random().toString(36).substr(2, 12) + "-" + cnt;
16035 }, "generateId");
16036 function makeRandomHex(length) {
16037 let result = "";
16038 const characters = "0123456789abcdef";
16039 const charactersLength = characters.length;
16040 for (let i = 0; i < length; i++) {
16041 result += characters.charAt(Math.floor(Math.random() * charactersLength));
16042 }
16043 return result;
16044 }
16045 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(makeRandomHex, "makeRandomHex");
16046 var random = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)((options) => {
16047 return makeRandomHex(options.length);
16048 }, "random");
16049 var getTextObj = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(function() {
16050 return {
16051 x: 0,
16052 y: 0,
16053 fill: void 0,
16054 anchor: "start",
16055 style: "#666",
16056 width: 100,
16057 height: 100,
16058 textMargin: 0,
16059 rx: 0,
16060 ry: 0,
16061 valign: void 0,
16062 text: ""
16063 };
16064 }, "getTextObj");
16065 var drawSimpleText = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(function(elem, textData) {
16066 const nText = textData.text.replace(_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .common_default */ .SY.lineBreakRegex, " ");
16067 const [, _fontSizePx] = parseFontSize(textData.fontSize);
16068 const textElem = elem.append("text");
16069 textElem.attr("x", textData.x);
16070 textElem.attr("y", textData.y);
16071 textElem.style("text-anchor", textData.anchor);
16072 textElem.style("font-family", textData.fontFamily);
16073 textElem.style("font-size", _fontSizePx);
16074 textElem.style("font-weight", textData.fontWeight);
16075 textElem.attr("fill", textData.fill);
16076 if (textData.class !== void 0) {
16077 textElem.attr("class", textData.class);
16078 }
16079 const span = textElem.append("tspan");
16080 span.attr("x", textData.x + textData.textMargin * 2);
16081 span.attr("fill", textData.fill);
16082 span.text(nText);
16083 return textElem;
16084 }, "drawSimpleText");
16085 var wrapLabel = (0,lodash_es_memoize_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z)(
16086 (label, maxWidth, config) => {
16087 if (!label) {
16088 return label;
16089 }
16090 config = Object.assign(
16091 { fontSize: 12, fontWeight: 400, fontFamily: "Arial", joinWith: "<br/>" },
16092 config
16093 );
16094 if (_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .common_default */ .SY.lineBreakRegex.test(label)) {
16095 return label;
16096 }
16097 const words = label.split(" ").filter(Boolean);
16098 const completedLines = [];
16099 let nextLine = "";
16100 words.forEach((word, index) => {
16101 const wordLength = calculateTextWidth(`${word} `, config);
16102 const nextLineLength = calculateTextWidth(nextLine, config);
16103 if (wordLength > maxWidth) {
16104 const { hyphenatedStrings, remainingWord } = breakString(word, maxWidth, "-", config);
16105 completedLines.push(nextLine, ...hyphenatedStrings);
16106 nextLine = remainingWord;
16107 } else if (nextLineLength + wordLength >= maxWidth) {
16108 completedLines.push(nextLine);
16109 nextLine = word;
16110 } else {
16111 nextLine = [nextLine, word].filter(Boolean).join(" ");
16112 }
16113 const currentWord = index + 1;
16114 const isLastWord = currentWord === words.length;
16115 if (isLastWord) {
16116 completedLines.push(nextLine);
16117 }
16118 });
16119 return completedLines.filter((line) => line !== "").join(config.joinWith);
16120 },
16121 (label, maxWidth, config) => `${label}${maxWidth}${config.fontSize}${config.fontWeight}${config.fontFamily}${config.joinWith}`
16122 );
16123 var breakString = (0,lodash_es_memoize_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z)(
16124 (word, maxWidth, hyphenCharacter = "-", config) => {
16125 config = Object.assign(
16126 { fontSize: 12, fontWeight: 400, fontFamily: "Arial", margin: 0 },
16127 config
16128 );
16129 const characters = [...word];
16130 const lines = [];
16131 let currentLine = "";
16132 characters.forEach((character, index) => {
16133 const nextLine = `${currentLine}${character}`;
16134 const lineWidth = calculateTextWidth(nextLine, config);
16135 if (lineWidth >= maxWidth) {
16136 const currentCharacter = index + 1;
16137 const isLastLine = characters.length === currentCharacter;
16138 const hyphenatedNextLine = `${nextLine}${hyphenCharacter}`;
16139 lines.push(isLastLine ? nextLine : hyphenatedNextLine);
16140 currentLine = "";
16141 } else {
16142 currentLine = nextLine;
16143 }
16144 });
16145 return { hyphenatedStrings: lines, remainingWord: currentLine };
16146 },
16147 (word, maxWidth, hyphenCharacter = "-", config) => `${word}${maxWidth}${hyphenCharacter}${config.fontSize}${config.fontWeight}${config.fontFamily}`
16148 );
16149 function calculateTextHeight(text, config) {
16150 return calculateTextDimensions(text, config).height;
16151 }
16152 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(calculateTextHeight, "calculateTextHeight");
16153 function calculateTextWidth(text, config) {
16154 return calculateTextDimensions(text, config).width;
16155 }
16156 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(calculateTextWidth, "calculateTextWidth");
16157 var calculateTextDimensions = (0,lodash_es_memoize_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z)(
16158 (text, config) => {
16159 const { fontSize = 12, fontFamily = "Arial", fontWeight = 400 } = config;
16160 if (!text) {
16161 return { width: 0, height: 0 };
16162 }
16163 const [, _fontSizePx] = parseFontSize(fontSize);
16164 const fontFamilies = ["sans-serif", fontFamily];
16165 const lines = text.split(_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .common_default */ .SY.lineBreakRegex);
16166 const dims = [];
16167 const body = (0,d3__WEBPACK_IMPORTED_MODULE_2__/* .select */ .Ys)("body");
16168 if (!body.remove) {
16169 return { width: 0, height: 0, lineHeight: 0 };
16170 }
16171 const g = body.append("svg");
16172 for (const fontFamily2 of fontFamilies) {
16173 let cHeight = 0;
16174 const dim = { width: 0, height: 0, lineHeight: 0 };
16175 for (const line of lines) {
16176 const textObj = getTextObj();
16177 textObj.text = line || ZERO_WIDTH_SPACE;
16178 const textElem = drawSimpleText(g, textObj).style("font-size", _fontSizePx).style("font-weight", fontWeight).style("font-family", fontFamily2);
16179 const bBox = (textElem._groups || textElem)[0][0].getBBox();
16180 if (bBox.width === 0 && bBox.height === 0) {
16181 throw new Error("svg element not in render tree");
16182 }
16183 dim.width = Math.round(Math.max(dim.width, bBox.width));
16184 cHeight = Math.round(bBox.height);
16185 dim.height += cHeight;
16186 dim.lineHeight = Math.round(Math.max(dim.lineHeight, cHeight));
16187 }
16188 dims.push(dim);
16189 }
16190 g.remove();
16191 const index = isNaN(dims[1].height) || isNaN(dims[1].width) || isNaN(dims[1].lineHeight) || dims[0].height > dims[1].height && dims[0].width > dims[1].width && dims[0].lineHeight > dims[1].lineHeight ? 0 : 1;
16192 return dims[index];
16193 },
16194 (text, config) => `${text}${config.fontSize}${config.fontWeight}${config.fontFamily}`
16195 );
16196 var InitIDGenerator = class {
16197 constructor(deterministic = false, seed) {
16198 this.count = 0;
16199 this.count = seed ? seed.length : 0;
16200 this.next = deterministic ? () => this.count++ : () => Date.now();
16201 }
16202 static {
16203 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(this, "InitIDGenerator");
16204 }
16205 };
16206 var decoder;
16207 var entityDecode = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(function(html) {
16208 decoder = decoder || document.createElement("div");
16209 html = escape(html).replace(/%26/g, "&").replace(/%23/g, "#").replace(/%3B/g, ";");
16210 decoder.innerHTML = html;
16211 return unescape(decoder.textContent);
16212 }, "entityDecode");
16213 function isDetailedError(error) {
16214 return "str" in error;
16215 }
16216 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(isDetailedError, "isDetailedError");
16217 var insertTitle = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)((parent, cssClass, titleTopMargin, title) => {
16218 if (!title) {
16219 return;
16220 }
16221 const bounds = parent.node()?.getBBox();
16222 if (!bounds) {
16223 return;
16224 }
16225 parent.append("text").text(title).attr("text-anchor", "middle").attr("x", bounds.x + bounds.width / 2).attr("y", -titleTopMargin).attr("class", cssClass);
16226 }, "insertTitle");
16227 var parseFontSize = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)((fontSize) => {
16228 if (typeof fontSize === "number") {
16229 return [fontSize, fontSize + "px"];
16230 }
16231 const fontSizeNumber = parseInt(fontSize ?? "", 10);
16232 if (Number.isNaN(fontSizeNumber)) {
16233 return [void 0, void 0];
16234 } else if (fontSize === String(fontSizeNumber)) {
16235 return [fontSizeNumber, fontSize + "px"];
16236 } else {
16237 return [fontSizeNumber, fontSize];
16238 }
16239 }, "parseFontSize");
16240 function cleanAndMerge(defaultData, data) {
16241 return (0,lodash_es_merge_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)({}, defaultData, data);
16242 }
16243 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(cleanAndMerge, "cleanAndMerge");
16244 var utils_default = {
16245 assignWithDepth: _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .assignWithDepth_default */ .Yc,
16246 wrapLabel,
16247 calculateTextHeight,
16248 calculateTextWidth,
16249 calculateTextDimensions,
16250 cleanAndMerge,
16251 detectInit,
16252 detectDirective,
16253 isSubstringInArray,
16254 interpolateToCurve,
16255 calcLabelPosition,
16256 calcCardinalityPosition,
16257 calcTerminalLabelPosition,
16258 formatUrl,
16259 getStylesFromArray,
16260 generateId,
16261 random,
16262 runFunc,
16263 entityDecode,
16264 insertTitle,
16265 parseFontSize,
16266 InitIDGenerator
16267 };
16268 var encodeEntities = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(function(text) {
16269 let txt = text;
16270 txt = txt.replace(/style.*:\S*#.*;/g, function(s) {
16271 return s.substring(0, s.length - 1);
16272 });
16273 txt = txt.replace(/classDef.*:\S*#.*;/g, function(s) {
16274 return s.substring(0, s.length - 1);
16275 });
16276 txt = txt.replace(/#\w+;/g, function(s) {
16277 const innerTxt = s.substring(1, s.length - 1);
16278 const isInt = /^\+?\d+$/.test(innerTxt);
16279 if (isInt) {
16280 return "\uFB02\xB0\xB0" + innerTxt + "\xB6\xDF";
16281 } else {
16282 return "\uFB02\xB0" + innerTxt + "\xB6\xDF";
16283 }
16284 });
16285 return txt;
16286 }, "encodeEntities");
16287 var decodeEntities = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(function(text) {
16288 return text.replace(/fl°°/g, "&#").replace(/fl°/g, "&").replace(/¶ß/g, ";");
16289 }, "decodeEntities");
16290 var getEdgeId = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)((from, to, {
16291 counter = 0,
16292 prefix,
16293 suffix
16294 }, id) => {
16295 if (id) {
16296 return id;
16297 }
16298 return `${prefix ? `${prefix}_` : ""}${from}_${to}_${counter}${suffix ? `_${suffix}` : ""}`;
16299 }, "getEdgeId");
16300 function handleUndefinedAttr(attrValue) {
16301 return attrValue ?? null;
16302 }
16303 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(handleUndefinedAttr, "handleUndefinedAttr");
16304
16305
16306
16307
16308 /***/ }),
16309
16310 /***/ 83696:
16311 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
16312
16313 "use strict";
16314 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
16315 /* harmony export */ _b: () => (/* binding */ getRegisteredLayoutAlgorithm),
16316 /* harmony export */ jM: () => (/* binding */ registerLayoutLoaders),
16317 /* harmony export */ sY: () => (/* binding */ render)
16318 /* harmony export */ });
16319 /* harmony import */ var _chunk_IIMUDSI4_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(52017);
16320 /* harmony import */ var _chunk_HRU6DDCH_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(41921);
16321 /* harmony import */ var _chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(42626);
16322 /* harmony import */ var _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(86906);
16323
16324
16325
16326
16327
16328 // src/internals.ts
16329 var internalHelpers = {
16330 common: _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .SY,
16331 getConfig: _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig */ .iE,
16332 insertCluster: _chunk_HRU6DDCH_mjs__WEBPACK_IMPORTED_MODULE_1__/* .insertCluster */ .us,
16333 insertEdge: _chunk_IIMUDSI4_mjs__WEBPACK_IMPORTED_MODULE_0__/* .insertEdge */ .QP,
16334 insertEdgeLabel: _chunk_IIMUDSI4_mjs__WEBPACK_IMPORTED_MODULE_0__/* .insertEdgeLabel */ .I_,
16335 insertMarkers: _chunk_IIMUDSI4_mjs__WEBPACK_IMPORTED_MODULE_0__/* .markers_default */ .DQ,
16336 insertNode: _chunk_HRU6DDCH_mjs__WEBPACK_IMPORTED_MODULE_1__/* .insertNode */ .Lf,
16337 interpolateToCurve: _chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_2__/* .interpolateToCurve */ .le,
16338 labelHelper: _chunk_HRU6DDCH_mjs__WEBPACK_IMPORTED_MODULE_1__/* .labelHelper */ .C1,
16339 log: _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .cM,
16340 positionEdgeLabel: _chunk_IIMUDSI4_mjs__WEBPACK_IMPORTED_MODULE_0__/* .positionEdgeLabel */ .Jj
16341 };
16342
16343 // src/rendering-util/render.ts
16344 var layoutAlgorithms = {};
16345 var registerLayoutLoaders = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .eW)((loaders) => {
16346 for (const loader of loaders) {
16347 layoutAlgorithms[loader.name] = loader;
16348 }
16349 }, "registerLayoutLoaders");
16350 var registerDefaultLayoutLoaders = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .eW)(() => {
16351 registerLayoutLoaders([
16352 {
16353 name: "dagre",
16354 loader: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .eW)(async () => await Promise.all(/* import() */[__webpack_require__.e(2228), __webpack_require__.e(4276), __webpack_require__.e(7561)]).then(__webpack_require__.bind(__webpack_require__, 7561)), "loader")
16355 }
16356 ]);
16357 }, "registerDefaultLayoutLoaders");
16358 registerDefaultLayoutLoaders();
16359 var render = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .eW)(async (data4Layout, svg) => {
16360 if (!(data4Layout.layoutAlgorithm in layoutAlgorithms)) {
16361 throw new Error(`Unknown layout algorithm: ${data4Layout.layoutAlgorithm}`);
16362 }
16363 const layoutDefinition = layoutAlgorithms[data4Layout.layoutAlgorithm];
16364 const layoutRenderer = await layoutDefinition.loader();
16365 return layoutRenderer.render(data4Layout, svg, internalHelpers, {
16366 algorithm: layoutDefinition.algorithm
16367 });
16368 }, "render");
16369 var getRegisteredLayoutAlgorithm = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .eW)((algorithm = "", { fallback = "dagre" } = {}) => {
16370 if (algorithm in layoutAlgorithms) {
16371 return algorithm;
16372 }
16373 if (fallback in layoutAlgorithms) {
16374 _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .cM.warn(`Layout algorithm ${algorithm} is not registered. Using ${fallback} as fallback.`);
16375 return fallback;
16376 }
16377 throw new Error(`Both layout algorithms ${algorithm} and ${fallback} are not registered.`);
16378 }, "getRegisteredLayoutAlgorithm");
16379
16380
16381
16382
16383 /***/ }),
16384
16385 /***/ 83133:
16386 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
16387
16388 "use strict";
16389 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
16390 /* harmony export */ o: () => (/* binding */ getLineFunctionsWithOffset)
16391 /* harmony export */ });
16392 /* harmony import */ var _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(86906);
16393
16394
16395 // src/utils/lineWithOffset.ts
16396 var markerOffsets = {
16397 aggregation: 18,
16398 extension: 18,
16399 composition: 18,
16400 dependency: 6,
16401 lollipop: 13.5,
16402 arrow_point: 4
16403 };
16404 function calculateDeltaAndAngle(point1, point2) {
16405 if (point1 === void 0 || point2 === void 0) {
16406 return { angle: 0, deltaX: 0, deltaY: 0 };
16407 }
16408 point1 = pointTransformer(point1);
16409 point2 = pointTransformer(point2);
16410 const [x1, y1] = [point1.x, point1.y];
16411 const [x2, y2] = [point2.x, point2.y];
16412 const deltaX = x2 - x1;
16413 const deltaY = y2 - y1;
16414 return { angle: Math.atan(deltaY / deltaX), deltaX, deltaY };
16415 }
16416 (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(calculateDeltaAndAngle, "calculateDeltaAndAngle");
16417 var pointTransformer = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)((data) => {
16418 if (Array.isArray(data)) {
16419 return { x: data[0], y: data[1] };
16420 }
16421 return data;
16422 }, "pointTransformer");
16423 var getLineFunctionsWithOffset = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)((edge) => {
16424 return {
16425 x: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(function(d, i, data) {
16426 let offset = 0;
16427 const DIRECTION = pointTransformer(data[0]).x < pointTransformer(data[data.length - 1]).x ? "left" : "right";
16428 if (i === 0 && Object.hasOwn(markerOffsets, edge.arrowTypeStart)) {
16429 const { angle, deltaX } = calculateDeltaAndAngle(data[0], data[1]);
16430 offset = markerOffsets[edge.arrowTypeStart] * Math.cos(angle) * (deltaX >= 0 ? 1 : -1);
16431 } else if (i === data.length - 1 && Object.hasOwn(markerOffsets, edge.arrowTypeEnd)) {
16432 const { angle, deltaX } = calculateDeltaAndAngle(
16433 data[data.length - 1],
16434 data[data.length - 2]
16435 );
16436 offset = markerOffsets[edge.arrowTypeEnd] * Math.cos(angle) * (deltaX >= 0 ? 1 : -1);
16437 }
16438 const differenceToEnd = Math.abs(
16439 pointTransformer(d).x - pointTransformer(data[data.length - 1]).x
16440 );
16441 const differenceInYEnd = Math.abs(
16442 pointTransformer(d).y - pointTransformer(data[data.length - 1]).y
16443 );
16444 const differenceToStart = Math.abs(pointTransformer(d).x - pointTransformer(data[0]).x);
16445 const differenceInYStart = Math.abs(pointTransformer(d).y - pointTransformer(data[0]).y);
16446 const startMarkerHeight = markerOffsets[edge.arrowTypeStart];
16447 const endMarkerHeight = markerOffsets[edge.arrowTypeEnd];
16448 const extraRoom = 1;
16449 if (differenceToEnd < endMarkerHeight && differenceToEnd > 0 && differenceInYEnd < endMarkerHeight) {
16450 let adjustment = endMarkerHeight + extraRoom - differenceToEnd;
16451 adjustment *= DIRECTION === "right" ? -1 : 1;
16452 offset -= adjustment;
16453 }
16454 if (differenceToStart < startMarkerHeight && differenceToStart > 0 && differenceInYStart < startMarkerHeight) {
16455 let adjustment = startMarkerHeight + extraRoom - differenceToStart;
16456 adjustment *= DIRECTION === "right" ? -1 : 1;
16457 offset += adjustment;
16458 }
16459 return pointTransformer(d).x + offset;
16460 }, "x"),
16461 y: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .eW)(function(d, i, data) {
16462 let offset = 0;
16463 const DIRECTION = pointTransformer(data[0]).y < pointTransformer(data[data.length - 1]).y ? "down" : "up";
16464 if (i === 0 && Object.hasOwn(markerOffsets, edge.arrowTypeStart)) {
16465 const { angle, deltaY } = calculateDeltaAndAngle(data[0], data[1]);
16466 offset = markerOffsets[edge.arrowTypeStart] * Math.abs(Math.sin(angle)) * (deltaY >= 0 ? 1 : -1);
16467 } else if (i === data.length - 1 && Object.hasOwn(markerOffsets, edge.arrowTypeEnd)) {
16468 const { angle, deltaY } = calculateDeltaAndAngle(
16469 data[data.length - 1],
16470 data[data.length - 2]
16471 );
16472 offset = markerOffsets[edge.arrowTypeEnd] * Math.abs(Math.sin(angle)) * (deltaY >= 0 ? 1 : -1);
16473 }
16474 const differenceToEnd = Math.abs(
16475 pointTransformer(d).y - pointTransformer(data[data.length - 1]).y
16476 );
16477 const differenceInXEnd = Math.abs(
16478 pointTransformer(d).x - pointTransformer(data[data.length - 1]).x
16479 );
16480 const differenceToStart = Math.abs(pointTransformer(d).y - pointTransformer(data[0]).y);
16481 const differenceInXStart = Math.abs(pointTransformer(d).x - pointTransformer(data[0]).x);
16482 const startMarkerHeight = markerOffsets[edge.arrowTypeStart];
16483 const endMarkerHeight = markerOffsets[edge.arrowTypeEnd];
16484 const extraRoom = 1;
16485 if (differenceToEnd < endMarkerHeight && differenceToEnd > 0 && differenceInXEnd < endMarkerHeight) {
16486 let adjustment = endMarkerHeight + extraRoom - differenceToEnd;
16487 adjustment *= DIRECTION === "up" ? -1 : 1;
16488 offset -= adjustment;
16489 }
16490 if (differenceToStart < startMarkerHeight && differenceToStart > 0 && differenceInXStart < startMarkerHeight) {
16491 let adjustment = startMarkerHeight + extraRoom - differenceToStart;
16492 adjustment *= DIRECTION === "up" ? -1 : 1;
16493 offset += adjustment;
16494 }
16495 return pointTransformer(d).y + offset;
16496 }, "y")
16497 };
16498 }, "getLineFunctionsWithOffset");
16499 if (void 0) {
16500 const { it, expect, describe } = void 0;
16501 describe("calculateDeltaAndAngle", () => {
16502 it("should calculate the angle and deltas between two points", () => {
16503 expect(calculateDeltaAndAngle([0, 0], [0, 1])).toStrictEqual({
16504 angle: 1.5707963267948966,
16505 deltaX: 0,
16506 deltaY: 1
16507 });
16508 expect(calculateDeltaAndAngle([1, 0], [0, -1])).toStrictEqual({
16509 angle: 0.7853981633974483,
16510 deltaX: -1,
16511 deltaY: -1
16512 });
16513 expect(calculateDeltaAndAngle({ x: 1, y: 0 }, [0, -1])).toStrictEqual({
16514 angle: 0.7853981633974483,
16515 deltaX: -1,
16516 deltaY: -1
16517 });
16518 expect(calculateDeltaAndAngle({ x: 1, y: 0 }, { x: 1, y: 0 })).toStrictEqual({
16519 angle: NaN,
16520 deltaX: 0,
16521 deltaY: 0
16522 });
16523 });
16524 it("should calculate the angle and deltas if one point in undefined", () => {
16525 expect(calculateDeltaAndAngle(void 0, [0, 1])).toStrictEqual({
16526 angle: 0,
16527 deltaX: 0,
16528 deltaY: 0
16529 });
16530 expect(calculateDeltaAndAngle([0, 1], void 0)).toStrictEqual({
16531 angle: 0,
16532 deltaX: 0,
16533 deltaY: 0
16534 });
16535 });
16536 });
16537 }
16538
16539
16540
16541
16542 /***/ }),
16543
16544 /***/ 86906:
16545 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
16546
16547 "use strict";
16548
16549 // EXPORTS
16550 __webpack_require__.d(__webpack_exports__, {
16551 cj: () => (/* binding */ UnknownDiagramError),
16552 r2: () => (/* binding */ __export),
16553 eW: () => (/* binding */ __name),
16554 XV: () => (/* binding */ addDirective),
16555 Yc: () => (/* binding */ assignWithDepth_default),
16556 nH: () => (/* binding */ calculateMathMLDimensions),
16557 ZH: () => (/* binding */ clear),
16558 LJ: () => (/* binding */ commonDb_exports),
16559 SY: () => (/* binding */ common_default),
16560 v2: () => (/* binding */ configureSvgSize),
16561 u_: () => (/* binding */ defaultConfig),
16562 Fy: () => (/* binding */ defaultConfig2),
16563 vZ: () => (/* binding */ defaultConfig_default),
16564 Vg: () => (/* binding */ detectType),
16565 Bf: () => (/* binding */ detectors),
16566 Zn: () => (/* binding */ directiveRegex),
16567 ku: () => (/* binding */ evaluate),
16568 M6: () => (/* binding */ frontMatterRegex),
16569 Mx: () => (/* binding */ getAccDescription),
16570 eu: () => (/* binding */ getAccTitle),
16571 iE: () => (/* binding */ getConfig),
16572 nV: () => (/* binding */ getConfig2),
16573 _7: () => (/* binding */ getDiagram),
16574 cq: () => (/* binding */ getDiagramLoader),
16575 Kr: () => (/* binding */ getDiagramTitle),
16576 ZD: () => (/* binding */ getSiteConfig),
16577 xN: () => (/* binding */ getThemeVariables3),
16578 l0: () => (/* binding */ hasKatex),
16579 Vw: () => (/* binding */ lineBreakRegex),
16580 cM: () => (/* binding */ log),
16581 UO: () => (/* binding */ parseGenericTypes),
16582 Cq: () => (/* binding */ registerDiagram),
16583 KO: () => (/* binding */ registerLazyLoadedDiagrams),
16584 uT: () => (/* binding */ renderKatex),
16585 mc: () => (/* binding */ chunk_YTJNT7DU_reset),
16586 NM: () => (/* binding */ sanitizeDirective),
16587 oO: () => (/* binding */ sanitizeText),
16588 uX: () => (/* binding */ sanitizeText3),
16589 dY: () => (/* binding */ saveConfigFromInitialize),
16590 U$: () => (/* binding */ setAccDescription),
16591 GN: () => (/* binding */ setAccTitle),
16592 v6: () => (/* binding */ setConfig),
16593 Y4: () => (/* binding */ setConfig2),
16594 g2: () => (/* binding */ setDiagramTitle),
16595 Ub: () => (/* binding */ setLogLevel),
16596 Yn: () => (/* binding */ setSiteConfig),
16597 j7: () => (/* binding */ setupGraphViewbox),
16598 Rw: () => (/* binding */ setupGraphViewbox2),
16599 Ee: () => (/* binding */ styles_default),
16600 _j: () => (/* binding */ themes_default),
16601 Tb: () => (/* binding */ updateSiteConfig)
16602 });
16603
16604 // EXTERNAL MODULE: ../node_modules/dayjs/dayjs.min.js
16605 var dayjs_min = __webpack_require__(27693);
16606 var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
16607 // EXTERNAL MODULE: ../node_modules/khroma/dist/color/index.js + 4 modules
16608 var dist_color = __webpack_require__(42528);
16609 // EXTERNAL MODULE: ../node_modules/khroma/dist/methods/change.js
16610 var change = __webpack_require__(95323);
16611 ;// CONCATENATED MODULE: ../node_modules/khroma/dist/methods/adjust.js
16612 /* IMPORT */
16613
16614
16615 /* MAIN */
16616 const adjust = (color, channels) => {
16617 const ch = dist_color/* default */.Z.parse(color);
16618 const changes = {};
16619 for (const c in channels) {
16620 if (!channels[c])
16621 continue;
16622 changes[c] = ch[c] + channels[c];
16623 }
16624 return (0,change/* default */.Z)(color, changes);
16625 };
16626 /* EXPORT */
16627 /* harmony default export */ const methods_adjust = (adjust);
16628
16629 // EXTERNAL MODULE: ../node_modules/khroma/dist/methods/rgba.js
16630 var rgba = __webpack_require__(14728);
16631 ;// CONCATENATED MODULE: ../node_modules/khroma/dist/methods/mix.js
16632 /* IMPORT */
16633
16634
16635 /* MAIN */
16636 //SOURCE: https://github.com/sass/dart-sass/blob/7457d2e9e7e623d9844ffd037a070cf32d39c348/lib/src/functions/color.dart#L718-L756
16637 const mix = (color1, color2, weight = 50) => {
16638 const { r: r1, g: g1, b: b1, a: a1 } = dist_color/* default */.Z.parse(color1);
16639 const { r: r2, g: g2, b: b2, a: a2 } = dist_color/* default */.Z.parse(color2);
16640 const weightScale = weight / 100;
16641 const weightNormalized = (weightScale * 2) - 1;
16642 const alphaDelta = a1 - a2;
16643 const weight1combined = ((weightNormalized * alphaDelta) === -1) ? weightNormalized : (weightNormalized + alphaDelta) / (1 + weightNormalized * alphaDelta);
16644 const weight1 = (weight1combined + 1) / 2;
16645 const weight2 = 1 - weight1;
16646 const r = (r1 * weight1) + (r2 * weight2);
16647 const g = (g1 * weight1) + (g2 * weight2);
16648 const b = (b1 * weight1) + (b2 * weight2);
16649 const a = (a1 * weightScale) + (a2 * (1 - weightScale));
16650 return (0,rgba/* default */.Z)(r, g, b, a);
16651 };
16652 /* EXPORT */
16653 /* harmony default export */ const methods_mix = (mix);
16654
16655 ;// CONCATENATED MODULE: ../node_modules/khroma/dist/methods/invert.js
16656 /* IMPORT */
16657
16658
16659 /* MAIN */
16660 const invert = (color, weight = 100) => {
16661 const inverse = dist_color/* default */.Z.parse(color);
16662 inverse.r = 255 - inverse.r;
16663 inverse.g = 255 - inverse.g;
16664 inverse.b = 255 - inverse.b;
16665 return methods_mix(inverse, color, weight);
16666 };
16667 /* EXPORT */
16668 /* harmony default export */ const methods_invert = (invert);
16669
16670 // EXTERNAL MODULE: ../node_modules/khroma/dist/methods/darken.js
16671 var darken = __webpack_require__(57838);
16672 // EXTERNAL MODULE: ../node_modules/khroma/dist/methods/lighten.js
16673 var lighten = __webpack_require__(28482);
16674 // EXTERNAL MODULE: ../node_modules/khroma/dist/methods/is_dark.js + 2 modules
16675 var is_dark = __webpack_require__(28186);
16676 // EXTERNAL MODULE: ../node_modules/dompurify/dist/purify.es.mjs
16677 var purify_es = __webpack_require__(4719);
16678 ;// CONCATENATED MODULE: ../node_modules/mermaid/dist/chunks/mermaid.core/chunk-YTJNT7DU.mjs
16679 var __defProp = Object.defineProperty;
16680 var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
16681 var __export = (target, all) => {
16682 for (var name in all)
16683 __defProp(target, name, { get: all[name], enumerable: true });
16684 };
16685
16686 // src/logger.ts
16687
16688 var LEVELS = {
16689 trace: 0,
16690 debug: 1,
16691 info: 2,
16692 warn: 3,
16693 error: 4,
16694 fatal: 5
16695 };
16696 var log = {
16697 trace: /* @__PURE__ */ __name((..._args) => {
16698 }, "trace"),
16699 debug: /* @__PURE__ */ __name((..._args) => {
16700 }, "debug"),
16701 info: /* @__PURE__ */ __name((..._args) => {
16702 }, "info"),
16703 warn: /* @__PURE__ */ __name((..._args) => {
16704 }, "warn"),
16705 error: /* @__PURE__ */ __name((..._args) => {
16706 }, "error"),
16707 fatal: /* @__PURE__ */ __name((..._args) => {
16708 }, "fatal")
16709 };
16710 var setLogLevel = /* @__PURE__ */ __name(function(level = "fatal") {
16711 let numericLevel = LEVELS.fatal;
16712 if (typeof level === "string") {
16713 if (level.toLowerCase() in LEVELS) {
16714 numericLevel = LEVELS[level];
16715 }
16716 } else if (typeof level === "number") {
16717 numericLevel = level;
16718 }
16719 log.trace = () => {
16720 };
16721 log.debug = () => {
16722 };
16723 log.info = () => {
16724 };
16725 log.warn = () => {
16726 };
16727 log.error = () => {
16728 };
16729 log.fatal = () => {
16730 };
16731 if (numericLevel <= LEVELS.fatal) {
16732 log.fatal = console.error ? console.error.bind(console, format("FATAL"), "color: orange") : console.log.bind(console, "\x1B[35m", format("FATAL"));
16733 }
16734 if (numericLevel <= LEVELS.error) {
16735 log.error = console.error ? console.error.bind(console, format("ERROR"), "color: orange") : console.log.bind(console, "\x1B[31m", format("ERROR"));
16736 }
16737 if (numericLevel <= LEVELS.warn) {
16738 log.warn = console.warn ? console.warn.bind(console, format("WARN"), "color: orange") : console.log.bind(console, `\x1B[33m`, format("WARN"));
16739 }
16740 if (numericLevel <= LEVELS.info) {
16741 log.info = console.info ? console.info.bind(console, format("INFO"), "color: lightblue") : console.log.bind(console, "\x1B[34m", format("INFO"));
16742 }
16743 if (numericLevel <= LEVELS.debug) {
16744 log.debug = console.debug ? console.debug.bind(console, format("DEBUG"), "color: lightgreen") : console.log.bind(console, "\x1B[32m", format("DEBUG"));
16745 }
16746 if (numericLevel <= LEVELS.trace) {
16747 log.trace = console.debug ? console.debug.bind(console, format("TRACE"), "color: lightgreen") : console.log.bind(console, "\x1B[32m", format("TRACE"));
16748 }
16749 }, "setLogLevel");
16750 var format = /* @__PURE__ */ __name((level) => {
16751 const time = dayjs_min_default()().format("ss.SSS");
16752 return `%c${time} : ${level} : `;
16753 }, "format");
16754
16755 // src/diagram-api/regexes.ts
16756 var frontMatterRegex = /^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s;
16757 var directiveRegex = /%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi;
16758 var anyCommentRegex = /\s*%%.*\n/gm;
16759
16760 // src/errors.ts
16761 var UnknownDiagramError = class extends Error {
16762 static {
16763 __name(this, "UnknownDiagramError");
16764 }
16765 constructor(message) {
16766 super(message);
16767 this.name = "UnknownDiagramError";
16768 }
16769 };
16770
16771 // src/diagram-api/detectType.ts
16772 var detectors = {};
16773 var detectType = /* @__PURE__ */ __name(function(text, config2) {
16774 text = text.replace(frontMatterRegex, "").replace(directiveRegex, "").replace(anyCommentRegex, "\n");
16775 for (const [key, { detector }] of Object.entries(detectors)) {
16776 const diagram = detector(text, config2);
16777 if (diagram) {
16778 return key;
16779 }
16780 }
16781 throw new UnknownDiagramError(
16782 `No diagram type detected matching given configuration for text: ${text}`
16783 );
16784 }, "detectType");
16785 var registerLazyLoadedDiagrams = /* @__PURE__ */ __name((...diagrams2) => {
16786 for (const { id, detector, loader } of diagrams2) {
16787 addDetector(id, detector, loader);
16788 }
16789 }, "registerLazyLoadedDiagrams");
16790 var addDetector = /* @__PURE__ */ __name((key, detector, loader) => {
16791 if (detectors[key]) {
16792 log.warn(`Detector with key ${key} already exists. Overwriting.`);
16793 }
16794 detectors[key] = { detector, loader };
16795 log.debug(`Detector with key ${key} added${loader ? " with loader" : ""}`);
16796 }, "addDetector");
16797 var getDiagramLoader = /* @__PURE__ */ __name((key) => {
16798 return detectors[key].loader;
16799 }, "getDiagramLoader");
16800
16801 // src/assignWithDepth.ts
16802 var assignWithDepth = /* @__PURE__ */ __name((dst, src, { depth = 2, clobber = false } = {}) => {
16803 const config2 = { depth, clobber };
16804 if (Array.isArray(src) && !Array.isArray(dst)) {
16805 src.forEach((s) => assignWithDepth(dst, s, config2));
16806 return dst;
16807 } else if (Array.isArray(src) && Array.isArray(dst)) {
16808 src.forEach((s) => {
16809 if (!dst.includes(s)) {
16810 dst.push(s);
16811 }
16812 });
16813 return dst;
16814 }
16815 if (dst === void 0 || depth <= 0) {
16816 if (dst !== void 0 && dst !== null && typeof dst === "object" && typeof src === "object") {
16817 return Object.assign(dst, src);
16818 } else {
16819 return src;
16820 }
16821 }
16822 if (src !== void 0 && typeof dst === "object" && typeof src === "object") {
16823 Object.keys(src).forEach((key) => {
16824 if (typeof src[key] === "object" && (dst[key] === void 0 || typeof dst[key] === "object")) {
16825 if (dst[key] === void 0) {
16826 dst[key] = Array.isArray(src[key]) ? [] : {};
16827 }
16828 dst[key] = assignWithDepth(dst[key], src[key], { depth: depth - 1, clobber });
16829 } else if (clobber || typeof dst[key] !== "object" && typeof src[key] !== "object") {
16830 dst[key] = src[key];
16831 }
16832 });
16833 }
16834 return dst;
16835 }, "assignWithDepth");
16836 var assignWithDepth_default = assignWithDepth;
16837
16838 // src/themes/theme-base.js
16839
16840
16841 // src/themes/erDiagram-oldHardcodedValues.ts
16842 var oldAttributeBackgroundColorOdd = "#ffffff";
16843 var oldAttributeBackgroundColorEven = "#f2f2f2";
16844
16845 // src/themes/theme-helpers.js
16846
16847 var mkBorder = /* @__PURE__ */ __name((col, darkMode) => darkMode ? methods_adjust(col, { s: -40, l: 10 }) : methods_adjust(col, { s: -40, l: -10 }), "mkBorder");
16848
16849 // src/themes/theme-base.js
16850 var Theme = class {
16851 static {
16852 __name(this, "Theme");
16853 }
16854 constructor() {
16855 this.background = "#f4f4f4";
16856 this.primaryColor = "#fff4dd";
16857 this.noteBkgColor = "#fff5ad";
16858 this.noteTextColor = "#333";
16859 this.THEME_COLOR_LIMIT = 12;
16860 this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif';
16861 this.fontSize = "16px";
16862 }
16863 updateColors() {
16864 this.primaryTextColor = this.primaryTextColor || (this.darkMode ? "#eee" : "#333");
16865 this.secondaryColor = this.secondaryColor || methods_adjust(this.primaryColor, { h: -120 });
16866 this.tertiaryColor = this.tertiaryColor || methods_adjust(this.primaryColor, { h: 180, l: 5 });
16867 this.primaryBorderColor = this.primaryBorderColor || mkBorder(this.primaryColor, this.darkMode);
16868 this.secondaryBorderColor = this.secondaryBorderColor || mkBorder(this.secondaryColor, this.darkMode);
16869 this.tertiaryBorderColor = this.tertiaryBorderColor || mkBorder(this.tertiaryColor, this.darkMode);
16870 this.noteBorderColor = this.noteBorderColor || mkBorder(this.noteBkgColor, this.darkMode);
16871 this.noteBkgColor = this.noteBkgColor || "#fff5ad";
16872 this.noteTextColor = this.noteTextColor || "#333";
16873 this.secondaryTextColor = this.secondaryTextColor || methods_invert(this.secondaryColor);
16874 this.tertiaryTextColor = this.tertiaryTextColor || methods_invert(this.tertiaryColor);
16875 this.lineColor = this.lineColor || methods_invert(this.background);
16876 this.arrowheadColor = this.arrowheadColor || methods_invert(this.background);
16877 this.textColor = this.textColor || this.primaryTextColor;
16878 this.border2 = this.border2 || this.tertiaryBorderColor;
16879 this.nodeBkg = this.nodeBkg || this.primaryColor;
16880 this.mainBkg = this.mainBkg || this.primaryColor;
16881 this.nodeBorder = this.nodeBorder || this.primaryBorderColor;
16882 this.clusterBkg = this.clusterBkg || this.tertiaryColor;
16883 this.clusterBorder = this.clusterBorder || this.tertiaryBorderColor;
16884 this.defaultLinkColor = this.defaultLinkColor || this.lineColor;
16885 this.titleColor = this.titleColor || this.tertiaryTextColor;
16886 this.edgeLabelBackground = this.edgeLabelBackground || (this.darkMode ? (0,darken/* default */.Z)(this.secondaryColor, 30) : this.secondaryColor);
16887 this.nodeTextColor = this.nodeTextColor || this.primaryTextColor;
16888 this.actorBorder = this.actorBorder || this.primaryBorderColor;
16889 this.actorBkg = this.actorBkg || this.mainBkg;
16890 this.actorTextColor = this.actorTextColor || this.primaryTextColor;
16891 this.actorLineColor = this.actorLineColor || this.actorBorder;
16892 this.labelBoxBkgColor = this.labelBoxBkgColor || this.actorBkg;
16893 this.signalColor = this.signalColor || this.textColor;
16894 this.signalTextColor = this.signalTextColor || this.textColor;
16895 this.labelBoxBorderColor = this.labelBoxBorderColor || this.actorBorder;
16896 this.labelTextColor = this.labelTextColor || this.actorTextColor;
16897 this.loopTextColor = this.loopTextColor || this.actorTextColor;
16898 this.activationBorderColor = this.activationBorderColor || (0,darken/* default */.Z)(this.secondaryColor, 10);
16899 this.activationBkgColor = this.activationBkgColor || this.secondaryColor;
16900 this.sequenceNumberColor = this.sequenceNumberColor || methods_invert(this.lineColor);
16901 this.sectionBkgColor = this.sectionBkgColor || this.tertiaryColor;
16902 this.altSectionBkgColor = this.altSectionBkgColor || "white";
16903 this.sectionBkgColor = this.sectionBkgColor || this.secondaryColor;
16904 this.sectionBkgColor2 = this.sectionBkgColor2 || this.primaryColor;
16905 this.excludeBkgColor = this.excludeBkgColor || "#eeeeee";
16906 this.taskBorderColor = this.taskBorderColor || this.primaryBorderColor;
16907 this.taskBkgColor = this.taskBkgColor || this.primaryColor;
16908 this.activeTaskBorderColor = this.activeTaskBorderColor || this.primaryColor;
16909 this.activeTaskBkgColor = this.activeTaskBkgColor || (0,lighten/* default */.Z)(this.primaryColor, 23);
16910 this.gridColor = this.gridColor || "lightgrey";
16911 this.doneTaskBkgColor = this.doneTaskBkgColor || "lightgrey";
16912 this.doneTaskBorderColor = this.doneTaskBorderColor || "grey";
16913 this.critBorderColor = this.critBorderColor || "#ff8888";
16914 this.critBkgColor = this.critBkgColor || "red";
16915 this.todayLineColor = this.todayLineColor || "red";
16916 this.taskTextColor = this.taskTextColor || this.textColor;
16917 this.taskTextOutsideColor = this.taskTextOutsideColor || this.textColor;
16918 this.taskTextLightColor = this.taskTextLightColor || this.textColor;
16919 this.taskTextColor = this.taskTextColor || this.primaryTextColor;
16920 this.taskTextDarkColor = this.taskTextDarkColor || this.textColor;
16921 this.taskTextClickableColor = this.taskTextClickableColor || "#003163";
16922 this.personBorder = this.personBorder || this.primaryBorderColor;
16923 this.personBkg = this.personBkg || this.mainBkg;
16924 if (this.darkMode) {
16925 this.rowOdd = this.rowOdd || (0,darken/* default */.Z)(this.mainBkg, 5) || "#ffffff";
16926 this.rowEven = this.rowEven || (0,darken/* default */.Z)(this.mainBkg, 10);
16927 } else {
16928 this.rowOdd = this.rowOdd || (0,lighten/* default */.Z)(this.mainBkg, 75) || "#ffffff";
16929 this.rowEven = this.rowEven || (0,lighten/* default */.Z)(this.mainBkg, 5);
16930 }
16931 this.transitionColor = this.transitionColor || this.lineColor;
16932 this.transitionLabelColor = this.transitionLabelColor || this.textColor;
16933 this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor;
16934 this.stateBkg = this.stateBkg || this.mainBkg;
16935 this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg;
16936 this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor;
16937 this.altBackground = this.altBackground || this.tertiaryColor;
16938 this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg;
16939 this.compositeBorder = this.compositeBorder || this.nodeBorder;
16940 this.innerEndBackground = this.nodeBorder;
16941 this.errorBkgColor = this.errorBkgColor || this.tertiaryColor;
16942 this.errorTextColor = this.errorTextColor || this.tertiaryTextColor;
16943 this.transitionColor = this.transitionColor || this.lineColor;
16944 this.specialStateColor = this.lineColor;
16945 this.cScale0 = this.cScale0 || this.primaryColor;
16946 this.cScale1 = this.cScale1 || this.secondaryColor;
16947 this.cScale2 = this.cScale2 || this.tertiaryColor;
16948 this.cScale3 = this.cScale3 || methods_adjust(this.primaryColor, { h: 30 });
16949 this.cScale4 = this.cScale4 || methods_adjust(this.primaryColor, { h: 60 });
16950 this.cScale5 = this.cScale5 || methods_adjust(this.primaryColor, { h: 90 });
16951 this.cScale6 = this.cScale6 || methods_adjust(this.primaryColor, { h: 120 });
16952 this.cScale7 = this.cScale7 || methods_adjust(this.primaryColor, { h: 150 });
16953 this.cScale8 = this.cScale8 || methods_adjust(this.primaryColor, { h: 210, l: 150 });
16954 this.cScale9 = this.cScale9 || methods_adjust(this.primaryColor, { h: 270 });
16955 this.cScale10 = this.cScale10 || methods_adjust(this.primaryColor, { h: 300 });
16956 this.cScale11 = this.cScale11 || methods_adjust(this.primaryColor, { h: 330 });
16957 if (this.darkMode) {
16958 for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
16959 this["cScale" + i] = (0,darken/* default */.Z)(this["cScale" + i], 75);
16960 }
16961 } else {
16962 for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
16963 this["cScale" + i] = (0,darken/* default */.Z)(this["cScale" + i], 25);
16964 }
16965 }
16966 for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
16967 this["cScaleInv" + i] = this["cScaleInv" + i] || methods_invert(this["cScale" + i]);
16968 }
16969 for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
16970 if (this.darkMode) {
16971 this["cScalePeer" + i] = this["cScalePeer" + i] || (0,lighten/* default */.Z)(this["cScale" + i], 10);
16972 } else {
16973 this["cScalePeer" + i] = this["cScalePeer" + i] || (0,darken/* default */.Z)(this["cScale" + i], 10);
16974 }
16975 }
16976 this.scaleLabelColor = this.scaleLabelColor || this.labelTextColor;
16977 for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
16978 this["cScaleLabel" + i] = this["cScaleLabel" + i] || this.scaleLabelColor;
16979 }
16980 const multiplier = this.darkMode ? -4 : -1;
16981 for (let i = 0; i < 5; i++) {
16982 this["surface" + i] = this["surface" + i] || methods_adjust(this.mainBkg, { h: 180, s: -15, l: multiplier * (5 + i * 3) });
16983 this["surfacePeer" + i] = this["surfacePeer" + i] || methods_adjust(this.mainBkg, { h: 180, s: -15, l: multiplier * (8 + i * 3) });
16984 }
16985 this.classText = this.classText || this.textColor;
16986 this.fillType0 = this.fillType0 || this.primaryColor;
16987 this.fillType1 = this.fillType1 || this.secondaryColor;
16988 this.fillType2 = this.fillType2 || methods_adjust(this.primaryColor, { h: 64 });
16989 this.fillType3 = this.fillType3 || methods_adjust(this.secondaryColor, { h: 64 });
16990 this.fillType4 = this.fillType4 || methods_adjust(this.primaryColor, { h: -64 });
16991 this.fillType5 = this.fillType5 || methods_adjust(this.secondaryColor, { h: -64 });
16992 this.fillType6 = this.fillType6 || methods_adjust(this.primaryColor, { h: 128 });
16993 this.fillType7 = this.fillType7 || methods_adjust(this.secondaryColor, { h: 128 });
16994 this.pie1 = this.pie1 || this.primaryColor;
16995 this.pie2 = this.pie2 || this.secondaryColor;
16996 this.pie3 = this.pie3 || this.tertiaryColor;
16997 this.pie4 = this.pie4 || methods_adjust(this.primaryColor, { l: -10 });
16998 this.pie5 = this.pie5 || methods_adjust(this.secondaryColor, { l: -10 });
16999 this.pie6 = this.pie6 || methods_adjust(this.tertiaryColor, { l: -10 });
17000 this.pie7 = this.pie7 || methods_adjust(this.primaryColor, { h: 60, l: -10 });
17001 this.pie8 = this.pie8 || methods_adjust(this.primaryColor, { h: -60, l: -10 });
17002 this.pie9 = this.pie9 || methods_adjust(this.primaryColor, { h: 120, l: 0 });
17003 this.pie10 = this.pie10 || methods_adjust(this.primaryColor, { h: 60, l: -20 });
17004 this.pie11 = this.pie11 || methods_adjust(this.primaryColor, { h: -60, l: -20 });
17005 this.pie12 = this.pie12 || methods_adjust(this.primaryColor, { h: 120, l: -10 });
17006 this.pieTitleTextSize = this.pieTitleTextSize || "25px";
17007 this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;
17008 this.pieSectionTextSize = this.pieSectionTextSize || "17px";
17009 this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;
17010 this.pieLegendTextSize = this.pieLegendTextSize || "17px";
17011 this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;
17012 this.pieStrokeColor = this.pieStrokeColor || "black";
17013 this.pieStrokeWidth = this.pieStrokeWidth || "2px";
17014 this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px";
17015 this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black";
17016 this.pieOpacity = this.pieOpacity || "0.7";
17017 this.radar = {
17018 axisColor: this.radar?.axisColor || this.lineColor,
17019 axisStrokeWidth: this.radar?.axisStrokeWidth || 2,
17020 axisLabelFontSize: this.radar?.axisLabelFontSize || 12,
17021 curveOpacity: this.radar?.curveOpacity || 0.5,
17022 curveStrokeWidth: this.radar?.curveStrokeWidth || 2,
17023 graticuleColor: this.radar?.graticuleColor || "#DEDEDE",
17024 graticuleStrokeWidth: this.radar?.graticuleStrokeWidth || 1,
17025 graticuleOpacity: this.radar?.graticuleOpacity || 0.3,
17026 legendBoxSize: this.radar?.legendBoxSize || 12,
17027 legendFontSize: this.radar?.legendFontSize || 12
17028 };
17029 this.archEdgeColor = this.archEdgeColor || "#777";
17030 this.archEdgeArrowColor = this.archEdgeArrowColor || "#777";
17031 this.archEdgeWidth = this.archEdgeWidth || "3";
17032 this.archGroupBorderColor = this.archGroupBorderColor || "#000";
17033 this.archGroupBorderWidth = this.archGroupBorderWidth || "2px";
17034 this.quadrant1Fill = this.quadrant1Fill || this.primaryColor;
17035 this.quadrant2Fill = this.quadrant2Fill || methods_adjust(this.primaryColor, { r: 5, g: 5, b: 5 });
17036 this.quadrant3Fill = this.quadrant3Fill || methods_adjust(this.primaryColor, { r: 10, g: 10, b: 10 });
17037 this.quadrant4Fill = this.quadrant4Fill || methods_adjust(this.primaryColor, { r: 15, g: 15, b: 15 });
17038 this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor;
17039 this.quadrant2TextFill = this.quadrant2TextFill || methods_adjust(this.primaryTextColor, { r: -5, g: -5, b: -5 });
17040 this.quadrant3TextFill = this.quadrant3TextFill || methods_adjust(this.primaryTextColor, { r: -10, g: -10, b: -10 });
17041 this.quadrant4TextFill = this.quadrant4TextFill || methods_adjust(this.primaryTextColor, { r: -15, g: -15, b: -15 });
17042 this.quadrantPointFill = this.quadrantPointFill || (0,is_dark/* default */.Z)(this.quadrant1Fill) ? (0,lighten/* default */.Z)(this.quadrant1Fill) : (0,darken/* default */.Z)(this.quadrant1Fill);
17043 this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor;
17044 this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor;
17045 this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor;
17046 this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor;
17047 this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor;
17048 this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor;
17049 this.xyChart = {
17050 backgroundColor: this.xyChart?.backgroundColor || this.background,
17051 titleColor: this.xyChart?.titleColor || this.primaryTextColor,
17052 xAxisTitleColor: this.xyChart?.xAxisTitleColor || this.primaryTextColor,
17053 xAxisLabelColor: this.xyChart?.xAxisLabelColor || this.primaryTextColor,
17054 xAxisTickColor: this.xyChart?.xAxisTickColor || this.primaryTextColor,
17055 xAxisLineColor: this.xyChart?.xAxisLineColor || this.primaryTextColor,
17056 yAxisTitleColor: this.xyChart?.yAxisTitleColor || this.primaryTextColor,
17057 yAxisLabelColor: this.xyChart?.yAxisLabelColor || this.primaryTextColor,
17058 yAxisTickColor: this.xyChart?.yAxisTickColor || this.primaryTextColor,
17059 yAxisLineColor: this.xyChart?.yAxisLineColor || this.primaryTextColor,
17060 plotColorPalette: this.xyChart?.plotColorPalette || "#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"
17061 };
17062 this.requirementBackground = this.requirementBackground || this.primaryColor;
17063 this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor;
17064 this.requirementBorderSize = this.requirementBorderSize || "1";
17065 this.requirementTextColor = this.requirementTextColor || this.primaryTextColor;
17066 this.relationColor = this.relationColor || this.lineColor;
17067 this.relationLabelBackground = this.relationLabelBackground || (this.darkMode ? (0,darken/* default */.Z)(this.secondaryColor, 30) : this.secondaryColor);
17068 this.relationLabelColor = this.relationLabelColor || this.actorTextColor;
17069 this.git0 = this.git0 || this.primaryColor;
17070 this.git1 = this.git1 || this.secondaryColor;
17071 this.git2 = this.git2 || this.tertiaryColor;
17072 this.git3 = this.git3 || methods_adjust(this.primaryColor, { h: -30 });
17073 this.git4 = this.git4 || methods_adjust(this.primaryColor, { h: -60 });
17074 this.git5 = this.git5 || methods_adjust(this.primaryColor, { h: -90 });
17075 this.git6 = this.git6 || methods_adjust(this.primaryColor, { h: 60 });
17076 this.git7 = this.git7 || methods_adjust(this.primaryColor, { h: 120 });
17077 if (this.darkMode) {
17078 this.git0 = (0,lighten/* default */.Z)(this.git0, 25);
17079 this.git1 = (0,lighten/* default */.Z)(this.git1, 25);
17080 this.git2 = (0,lighten/* default */.Z)(this.git2, 25);
17081 this.git3 = (0,lighten/* default */.Z)(this.git3, 25);
17082 this.git4 = (0,lighten/* default */.Z)(this.git4, 25);
17083 this.git5 = (0,lighten/* default */.Z)(this.git5, 25);
17084 this.git6 = (0,lighten/* default */.Z)(this.git6, 25);
17085 this.git7 = (0,lighten/* default */.Z)(this.git7, 25);
17086 } else {
17087 this.git0 = (0,darken/* default */.Z)(this.git0, 25);
17088 this.git1 = (0,darken/* default */.Z)(this.git1, 25);
17089 this.git2 = (0,darken/* default */.Z)(this.git2, 25);
17090 this.git3 = (0,darken/* default */.Z)(this.git3, 25);
17091 this.git4 = (0,darken/* default */.Z)(this.git4, 25);
17092 this.git5 = (0,darken/* default */.Z)(this.git5, 25);
17093 this.git6 = (0,darken/* default */.Z)(this.git6, 25);
17094 this.git7 = (0,darken/* default */.Z)(this.git7, 25);
17095 }
17096 this.gitInv0 = this.gitInv0 || methods_invert(this.git0);
17097 this.gitInv1 = this.gitInv1 || methods_invert(this.git1);
17098 this.gitInv2 = this.gitInv2 || methods_invert(this.git2);
17099 this.gitInv3 = this.gitInv3 || methods_invert(this.git3);
17100 this.gitInv4 = this.gitInv4 || methods_invert(this.git4);
17101 this.gitInv5 = this.gitInv5 || methods_invert(this.git5);
17102 this.gitInv6 = this.gitInv6 || methods_invert(this.git6);
17103 this.gitInv7 = this.gitInv7 || methods_invert(this.git7);
17104 this.branchLabelColor = this.branchLabelColor || (this.darkMode ? "black" : this.labelTextColor);
17105 this.gitBranchLabel0 = this.gitBranchLabel0 || this.branchLabelColor;
17106 this.gitBranchLabel1 = this.gitBranchLabel1 || this.branchLabelColor;
17107 this.gitBranchLabel2 = this.gitBranchLabel2 || this.branchLabelColor;
17108 this.gitBranchLabel3 = this.gitBranchLabel3 || this.branchLabelColor;
17109 this.gitBranchLabel4 = this.gitBranchLabel4 || this.branchLabelColor;
17110 this.gitBranchLabel5 = this.gitBranchLabel5 || this.branchLabelColor;
17111 this.gitBranchLabel6 = this.gitBranchLabel6 || this.branchLabelColor;
17112 this.gitBranchLabel7 = this.gitBranchLabel7 || this.branchLabelColor;
17113 this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;
17114 this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;
17115 this.tagLabelBorder = this.tagBorder || this.primaryBorderColor;
17116 this.tagLabelFontSize = this.tagLabelFontSize || "10px";
17117 this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor;
17118 this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor;
17119 this.commitLabelFontSize = this.commitLabelFontSize || "10px";
17120 this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || oldAttributeBackgroundColorOdd;
17121 this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || oldAttributeBackgroundColorEven;
17122 }
17123 calculate(overrides) {
17124 if (typeof overrides !== "object") {
17125 this.updateColors();
17126 return;
17127 }
17128 const keys = Object.keys(overrides);
17129 keys.forEach((k) => {
17130 this[k] = overrides[k];
17131 });
17132 this.updateColors();
17133 keys.forEach((k) => {
17134 this[k] = overrides[k];
17135 });
17136 }
17137 };
17138 var getThemeVariables = /* @__PURE__ */ __name((userOverrides) => {
17139 const theme = new Theme();
17140 theme.calculate(userOverrides);
17141 return theme;
17142 }, "getThemeVariables");
17143
17144 // src/themes/theme-dark.js
17145
17146 var Theme2 = class {
17147 static {
17148 __name(this, "Theme");
17149 }
17150 constructor() {
17151 this.background = "#333";
17152 this.primaryColor = "#1f2020";
17153 this.secondaryColor = (0,lighten/* default */.Z)(this.primaryColor, 16);
17154 this.tertiaryColor = methods_adjust(this.primaryColor, { h: -160 });
17155 this.primaryBorderColor = methods_invert(this.background);
17156 this.secondaryBorderColor = mkBorder(this.secondaryColor, this.darkMode);
17157 this.tertiaryBorderColor = mkBorder(this.tertiaryColor, this.darkMode);
17158 this.primaryTextColor = methods_invert(this.primaryColor);
17159 this.secondaryTextColor = methods_invert(this.secondaryColor);
17160 this.tertiaryTextColor = methods_invert(this.tertiaryColor);
17161 this.lineColor = methods_invert(this.background);
17162 this.textColor = methods_invert(this.background);
17163 this.mainBkg = "#1f2020";
17164 this.secondBkg = "calculated";
17165 this.mainContrastColor = "lightgrey";
17166 this.darkTextColor = (0,lighten/* default */.Z)(methods_invert("#323D47"), 10);
17167 this.lineColor = "calculated";
17168 this.border1 = "#ccc";
17169 this.border2 = (0,rgba/* default */.Z)(255, 255, 255, 0.25);
17170 this.arrowheadColor = "calculated";
17171 this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif';
17172 this.fontSize = "16px";
17173 this.labelBackground = "#181818";
17174 this.textColor = "#ccc";
17175 this.THEME_COLOR_LIMIT = 12;
17176 this.nodeBkg = "calculated";
17177 this.nodeBorder = "calculated";
17178 this.clusterBkg = "calculated";
17179 this.clusterBorder = "calculated";
17180 this.defaultLinkColor = "calculated";
17181 this.titleColor = "#F9FFFE";
17182 this.edgeLabelBackground = "calculated";
17183 this.actorBorder = "calculated";
17184 this.actorBkg = "calculated";
17185 this.actorTextColor = "calculated";
17186 this.actorLineColor = "calculated";
17187 this.signalColor = "calculated";
17188 this.signalTextColor = "calculated";
17189 this.labelBoxBkgColor = "calculated";
17190 this.labelBoxBorderColor = "calculated";
17191 this.labelTextColor = "calculated";
17192 this.loopTextColor = "calculated";
17193 this.noteBorderColor = "calculated";
17194 this.noteBkgColor = "#fff5ad";
17195 this.noteTextColor = "calculated";
17196 this.activationBorderColor = "calculated";
17197 this.activationBkgColor = "calculated";
17198 this.sequenceNumberColor = "black";
17199 this.sectionBkgColor = (0,darken/* default */.Z)("#EAE8D9", 30);
17200 this.altSectionBkgColor = "calculated";
17201 this.sectionBkgColor2 = "#EAE8D9";
17202 this.excludeBkgColor = (0,darken/* default */.Z)(this.sectionBkgColor, 10);
17203 this.taskBorderColor = (0,rgba/* default */.Z)(255, 255, 255, 70);
17204 this.taskBkgColor = "calculated";
17205 this.taskTextColor = "calculated";
17206 this.taskTextLightColor = "calculated";
17207 this.taskTextOutsideColor = "calculated";
17208 this.taskTextClickableColor = "#003163";
17209 this.activeTaskBorderColor = (0,rgba/* default */.Z)(255, 255, 255, 50);
17210 this.activeTaskBkgColor = "#81B1DB";
17211 this.gridColor = "calculated";
17212 this.doneTaskBkgColor = "calculated";
17213 this.doneTaskBorderColor = "grey";
17214 this.critBorderColor = "#E83737";
17215 this.critBkgColor = "#E83737";
17216 this.taskTextDarkColor = "calculated";
17217 this.todayLineColor = "#DB5757";
17218 this.personBorder = this.primaryBorderColor;
17219 this.personBkg = this.mainBkg;
17220 this.archEdgeColor = "calculated";
17221 this.archEdgeArrowColor = "calculated";
17222 this.archEdgeWidth = "3";
17223 this.archGroupBorderColor = this.primaryBorderColor;
17224 this.archGroupBorderWidth = "2px";
17225 this.rowOdd = this.rowOdd || (0,lighten/* default */.Z)(this.mainBkg, 5) || "#ffffff";
17226 this.rowEven = this.rowEven || (0,darken/* default */.Z)(this.mainBkg, 10);
17227 this.labelColor = "calculated";
17228 this.errorBkgColor = "#a44141";
17229 this.errorTextColor = "#ddd";
17230 }
17231 updateColors() {
17232 this.secondBkg = (0,lighten/* default */.Z)(this.mainBkg, 16);
17233 this.lineColor = this.mainContrastColor;
17234 this.arrowheadColor = this.mainContrastColor;
17235 this.nodeBkg = this.mainBkg;
17236 this.nodeBorder = this.border1;
17237 this.clusterBkg = this.secondBkg;
17238 this.clusterBorder = this.border2;
17239 this.defaultLinkColor = this.lineColor;
17240 this.edgeLabelBackground = (0,lighten/* default */.Z)(this.labelBackground, 25);
17241 this.actorBorder = this.border1;
17242 this.actorBkg = this.mainBkg;
17243 this.actorTextColor = this.mainContrastColor;
17244 this.actorLineColor = this.actorBorder;
17245 this.signalColor = this.mainContrastColor;
17246 this.signalTextColor = this.mainContrastColor;
17247 this.labelBoxBkgColor = this.actorBkg;
17248 this.labelBoxBorderColor = this.actorBorder;
17249 this.labelTextColor = this.mainContrastColor;
17250 this.loopTextColor = this.mainContrastColor;
17251 this.noteBorderColor = this.secondaryBorderColor;
17252 this.noteBkgColor = this.secondBkg;
17253 this.noteTextColor = this.secondaryTextColor;
17254 this.activationBorderColor = this.border1;
17255 this.activationBkgColor = this.secondBkg;
17256 this.altSectionBkgColor = this.background;
17257 this.taskBkgColor = (0,lighten/* default */.Z)(this.mainBkg, 23);
17258 this.taskTextColor = this.darkTextColor;
17259 this.taskTextLightColor = this.mainContrastColor;
17260 this.taskTextOutsideColor = this.taskTextLightColor;
17261 this.gridColor = this.mainContrastColor;
17262 this.doneTaskBkgColor = this.mainContrastColor;
17263 this.taskTextDarkColor = this.darkTextColor;
17264 this.archEdgeColor = this.lineColor;
17265 this.archEdgeArrowColor = this.lineColor;
17266 this.transitionColor = this.transitionColor || this.lineColor;
17267 this.transitionLabelColor = this.transitionLabelColor || this.textColor;
17268 this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor;
17269 this.stateBkg = this.stateBkg || this.mainBkg;
17270 this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg;
17271 this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor;
17272 this.altBackground = this.altBackground || "#555";
17273 this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg;
17274 this.compositeBorder = this.compositeBorder || this.nodeBorder;
17275 this.innerEndBackground = this.primaryBorderColor;
17276 this.specialStateColor = "#f4f4f4";
17277 this.errorBkgColor = this.errorBkgColor || this.tertiaryColor;
17278 this.errorTextColor = this.errorTextColor || this.tertiaryTextColor;
17279 this.fillType0 = this.primaryColor;
17280 this.fillType1 = this.secondaryColor;
17281 this.fillType2 = methods_adjust(this.primaryColor, { h: 64 });
17282 this.fillType3 = methods_adjust(this.secondaryColor, { h: 64 });
17283 this.fillType4 = methods_adjust(this.primaryColor, { h: -64 });
17284 this.fillType5 = methods_adjust(this.secondaryColor, { h: -64 });
17285 this.fillType6 = methods_adjust(this.primaryColor, { h: 128 });
17286 this.fillType7 = methods_adjust(this.secondaryColor, { h: 128 });
17287 this.cScale1 = this.cScale1 || "#0b0000";
17288 this.cScale2 = this.cScale2 || "#4d1037";
17289 this.cScale3 = this.cScale3 || "#3f5258";
17290 this.cScale4 = this.cScale4 || "#4f2f1b";
17291 this.cScale5 = this.cScale5 || "#6e0a0a";
17292 this.cScale6 = this.cScale6 || "#3b0048";
17293 this.cScale7 = this.cScale7 || "#995a01";
17294 this.cScale8 = this.cScale8 || "#154706";
17295 this.cScale9 = this.cScale9 || "#161722";
17296 this.cScale10 = this.cScale10 || "#00296f";
17297 this.cScale11 = this.cScale11 || "#01629c";
17298 this.cScale12 = this.cScale12 || "#010029";
17299 this.cScale0 = this.cScale0 || this.primaryColor;
17300 this.cScale1 = this.cScale1 || this.secondaryColor;
17301 this.cScale2 = this.cScale2 || this.tertiaryColor;
17302 this.cScale3 = this.cScale3 || methods_adjust(this.primaryColor, { h: 30 });
17303 this.cScale4 = this.cScale4 || methods_adjust(this.primaryColor, { h: 60 });
17304 this.cScale5 = this.cScale5 || methods_adjust(this.primaryColor, { h: 90 });
17305 this.cScale6 = this.cScale6 || methods_adjust(this.primaryColor, { h: 120 });
17306 this.cScale7 = this.cScale7 || methods_adjust(this.primaryColor, { h: 150 });
17307 this.cScale8 = this.cScale8 || methods_adjust(this.primaryColor, { h: 210 });
17308 this.cScale9 = this.cScale9 || methods_adjust(this.primaryColor, { h: 270 });
17309 this.cScale10 = this.cScale10 || methods_adjust(this.primaryColor, { h: 300 });
17310 this.cScale11 = this.cScale11 || methods_adjust(this.primaryColor, { h: 330 });
17311 for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
17312 this["cScaleInv" + i] = this["cScaleInv" + i] || methods_invert(this["cScale" + i]);
17313 }
17314 for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
17315 this["cScalePeer" + i] = this["cScalePeer" + i] || (0,lighten/* default */.Z)(this["cScale" + i], 10);
17316 }
17317 for (let i = 0; i < 5; i++) {
17318 this["surface" + i] = this["surface" + i] || methods_adjust(this.mainBkg, { h: 30, s: -30, l: -(-10 + i * 4) });
17319 this["surfacePeer" + i] = this["surfacePeer" + i] || methods_adjust(this.mainBkg, { h: 30, s: -30, l: -(-7 + i * 4) });
17320 }
17321 this.scaleLabelColor = this.scaleLabelColor || (this.darkMode ? "black" : this.labelTextColor);
17322 for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
17323 this["cScaleLabel" + i] = this["cScaleLabel" + i] || this.scaleLabelColor;
17324 }
17325 for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
17326 this["pie" + i] = this["cScale" + i];
17327 }
17328 this.pieTitleTextSize = this.pieTitleTextSize || "25px";
17329 this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;
17330 this.pieSectionTextSize = this.pieSectionTextSize || "17px";
17331 this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;
17332 this.pieLegendTextSize = this.pieLegendTextSize || "17px";
17333 this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;
17334 this.pieStrokeColor = this.pieStrokeColor || "black";
17335 this.pieStrokeWidth = this.pieStrokeWidth || "2px";
17336 this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px";
17337 this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black";
17338 this.pieOpacity = this.pieOpacity || "0.7";
17339 this.quadrant1Fill = this.quadrant1Fill || this.primaryColor;
17340 this.quadrant2Fill = this.quadrant2Fill || methods_adjust(this.primaryColor, { r: 5, g: 5, b: 5 });
17341 this.quadrant3Fill = this.quadrant3Fill || methods_adjust(this.primaryColor, { r: 10, g: 10, b: 10 });
17342 this.quadrant4Fill = this.quadrant4Fill || methods_adjust(this.primaryColor, { r: 15, g: 15, b: 15 });
17343 this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor;
17344 this.quadrant2TextFill = this.quadrant2TextFill || methods_adjust(this.primaryTextColor, { r: -5, g: -5, b: -5 });
17345 this.quadrant3TextFill = this.quadrant3TextFill || methods_adjust(this.primaryTextColor, { r: -10, g: -10, b: -10 });
17346 this.quadrant4TextFill = this.quadrant4TextFill || methods_adjust(this.primaryTextColor, { r: -15, g: -15, b: -15 });
17347 this.quadrantPointFill = this.quadrantPointFill || (0,is_dark/* default */.Z)(this.quadrant1Fill) ? (0,lighten/* default */.Z)(this.quadrant1Fill) : (0,darken/* default */.Z)(this.quadrant1Fill);
17348 this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor;
17349 this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor;
17350 this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor;
17351 this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor;
17352 this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor;
17353 this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor;
17354 this.xyChart = {
17355 backgroundColor: this.xyChart?.backgroundColor || this.background,
17356 titleColor: this.xyChart?.titleColor || this.primaryTextColor,
17357 xAxisTitleColor: this.xyChart?.xAxisTitleColor || this.primaryTextColor,
17358 xAxisLabelColor: this.xyChart?.xAxisLabelColor || this.primaryTextColor,
17359 xAxisTickColor: this.xyChart?.xAxisTickColor || this.primaryTextColor,
17360 xAxisLineColor: this.xyChart?.xAxisLineColor || this.primaryTextColor,
17361 yAxisTitleColor: this.xyChart?.yAxisTitleColor || this.primaryTextColor,
17362 yAxisLabelColor: this.xyChart?.yAxisLabelColor || this.primaryTextColor,
17363 yAxisTickColor: this.xyChart?.yAxisTickColor || this.primaryTextColor,
17364 yAxisLineColor: this.xyChart?.yAxisLineColor || this.primaryTextColor,
17365 plotColorPalette: this.xyChart?.plotColorPalette || "#3498db,#2ecc71,#e74c3c,#f1c40f,#bdc3c7,#ffffff,#34495e,#9b59b6,#1abc9c,#e67e22"
17366 };
17367 this.packet = {
17368 startByteColor: this.primaryTextColor,
17369 endByteColor: this.primaryTextColor,
17370 labelColor: this.primaryTextColor,
17371 titleColor: this.primaryTextColor,
17372 blockStrokeColor: this.primaryTextColor,
17373 blockFillColor: this.background
17374 };
17375 this.radar = {
17376 axisColor: this.radar?.axisColor || this.lineColor,
17377 axisStrokeWidth: this.radar?.axisStrokeWidth || 2,
17378 axisLabelFontSize: this.radar?.axisLabelFontSize || 12,
17379 curveOpacity: this.radar?.curveOpacity || 0.5,
17380 curveStrokeWidth: this.radar?.curveStrokeWidth || 2,
17381 graticuleColor: this.radar?.graticuleColor || "#DEDEDE",
17382 graticuleStrokeWidth: this.radar?.graticuleStrokeWidth || 1,
17383 graticuleOpacity: this.radar?.graticuleOpacity || 0.3,
17384 legendBoxSize: this.radar?.legendBoxSize || 12,
17385 legendFontSize: this.radar?.legendFontSize || 12
17386 };
17387 this.classText = this.primaryTextColor;
17388 this.requirementBackground = this.requirementBackground || this.primaryColor;
17389 this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor;
17390 this.requirementBorderSize = this.requirementBorderSize || "1";
17391 this.requirementTextColor = this.requirementTextColor || this.primaryTextColor;
17392 this.relationColor = this.relationColor || this.lineColor;
17393 this.relationLabelBackground = this.relationLabelBackground || (this.darkMode ? (0,darken/* default */.Z)(this.secondaryColor, 30) : this.secondaryColor);
17394 this.relationLabelColor = this.relationLabelColor || this.actorTextColor;
17395 this.git0 = (0,lighten/* default */.Z)(this.secondaryColor, 20);
17396 this.git1 = (0,lighten/* default */.Z)(this.pie2 || this.secondaryColor, 20);
17397 this.git2 = (0,lighten/* default */.Z)(this.pie3 || this.tertiaryColor, 20);
17398 this.git3 = (0,lighten/* default */.Z)(this.pie4 || methods_adjust(this.primaryColor, { h: -30 }), 20);
17399 this.git4 = (0,lighten/* default */.Z)(this.pie5 || methods_adjust(this.primaryColor, { h: -60 }), 20);
17400 this.git5 = (0,lighten/* default */.Z)(this.pie6 || methods_adjust(this.primaryColor, { h: -90 }), 10);
17401 this.git6 = (0,lighten/* default */.Z)(this.pie7 || methods_adjust(this.primaryColor, { h: 60 }), 10);
17402 this.git7 = (0,lighten/* default */.Z)(this.pie8 || methods_adjust(this.primaryColor, { h: 120 }), 20);
17403 this.gitInv0 = this.gitInv0 || methods_invert(this.git0);
17404 this.gitInv1 = this.gitInv1 || methods_invert(this.git1);
17405 this.gitInv2 = this.gitInv2 || methods_invert(this.git2);
17406 this.gitInv3 = this.gitInv3 || methods_invert(this.git3);
17407 this.gitInv4 = this.gitInv4 || methods_invert(this.git4);
17408 this.gitInv5 = this.gitInv5 || methods_invert(this.git5);
17409 this.gitInv6 = this.gitInv6 || methods_invert(this.git6);
17410 this.gitInv7 = this.gitInv7 || methods_invert(this.git7);
17411 this.gitBranchLabel0 = this.gitBranchLabel0 || methods_invert(this.labelTextColor);
17412 this.gitBranchLabel1 = this.gitBranchLabel1 || this.labelTextColor;
17413 this.gitBranchLabel2 = this.gitBranchLabel2 || this.labelTextColor;
17414 this.gitBranchLabel3 = this.gitBranchLabel3 || methods_invert(this.labelTextColor);
17415 this.gitBranchLabel4 = this.gitBranchLabel4 || this.labelTextColor;
17416 this.gitBranchLabel5 = this.gitBranchLabel5 || this.labelTextColor;
17417 this.gitBranchLabel6 = this.gitBranchLabel6 || this.labelTextColor;
17418 this.gitBranchLabel7 = this.gitBranchLabel7 || this.labelTextColor;
17419 this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;
17420 this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;
17421 this.tagLabelBorder = this.tagBorder || this.primaryBorderColor;
17422 this.tagLabelFontSize = this.tagLabelFontSize || "10px";
17423 this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor;
17424 this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor;
17425 this.commitLabelFontSize = this.commitLabelFontSize || "10px";
17426 this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || (0,lighten/* default */.Z)(this.background, 12);
17427 this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || (0,lighten/* default */.Z)(this.background, 2);
17428 this.nodeBorder = this.nodeBorder || "#999";
17429 }
17430 calculate(overrides) {
17431 if (typeof overrides !== "object") {
17432 this.updateColors();
17433 return;
17434 }
17435 const keys = Object.keys(overrides);
17436 keys.forEach((k) => {
17437 this[k] = overrides[k];
17438 });
17439 this.updateColors();
17440 keys.forEach((k) => {
17441 this[k] = overrides[k];
17442 });
17443 }
17444 };
17445 var getThemeVariables2 = /* @__PURE__ */ __name((userOverrides) => {
17446 const theme = new Theme2();
17447 theme.calculate(userOverrides);
17448 return theme;
17449 }, "getThemeVariables");
17450
17451 // src/themes/theme-default.js
17452
17453 var Theme3 = class {
17454 static {
17455 __name(this, "Theme");
17456 }
17457 constructor() {
17458 this.background = "#f4f4f4";
17459 this.primaryColor = "#ECECFF";
17460 this.secondaryColor = methods_adjust(this.primaryColor, { h: 120 });
17461 this.secondaryColor = "#ffffde";
17462 this.tertiaryColor = methods_adjust(this.primaryColor, { h: -160 });
17463 this.primaryBorderColor = mkBorder(this.primaryColor, this.darkMode);
17464 this.secondaryBorderColor = mkBorder(this.secondaryColor, this.darkMode);
17465 this.tertiaryBorderColor = mkBorder(this.tertiaryColor, this.darkMode);
17466 this.primaryTextColor = methods_invert(this.primaryColor);
17467 this.secondaryTextColor = methods_invert(this.secondaryColor);
17468 this.tertiaryTextColor = methods_invert(this.tertiaryColor);
17469 this.lineColor = methods_invert(this.background);
17470 this.textColor = methods_invert(this.background);
17471 this.background = "white";
17472 this.mainBkg = "#ECECFF";
17473 this.secondBkg = "#ffffde";
17474 this.lineColor = "#333333";
17475 this.border1 = "#9370DB";
17476 this.border2 = "#aaaa33";
17477 this.arrowheadColor = "#333333";
17478 this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif';
17479 this.fontSize = "16px";
17480 this.labelBackground = "rgba(232,232,232, 0.8)";
17481 this.textColor = "#333";
17482 this.THEME_COLOR_LIMIT = 12;
17483 this.nodeBkg = "calculated";
17484 this.nodeBorder = "calculated";
17485 this.clusterBkg = "calculated";
17486 this.clusterBorder = "calculated";
17487 this.defaultLinkColor = "calculated";
17488 this.titleColor = "calculated";
17489 this.edgeLabelBackground = "calculated";
17490 this.actorBorder = "calculated";
17491 this.actorBkg = "calculated";
17492 this.actorTextColor = "black";
17493 this.actorLineColor = "calculated";
17494 this.signalColor = "calculated";
17495 this.signalTextColor = "calculated";
17496 this.labelBoxBkgColor = "calculated";
17497 this.labelBoxBorderColor = "calculated";
17498 this.labelTextColor = "calculated";
17499 this.loopTextColor = "calculated";
17500 this.noteBorderColor = "calculated";
17501 this.noteBkgColor = "#fff5ad";
17502 this.noteTextColor = "calculated";
17503 this.activationBorderColor = "#666";
17504 this.activationBkgColor = "#f4f4f4";
17505 this.sequenceNumberColor = "white";
17506 this.sectionBkgColor = "calculated";
17507 this.altSectionBkgColor = "calculated";
17508 this.sectionBkgColor2 = "calculated";
17509 this.excludeBkgColor = "#eeeeee";
17510 this.taskBorderColor = "calculated";
17511 this.taskBkgColor = "calculated";
17512 this.taskTextLightColor = "calculated";
17513 this.taskTextColor = this.taskTextLightColor;
17514 this.taskTextDarkColor = "calculated";
17515 this.taskTextOutsideColor = this.taskTextDarkColor;
17516 this.taskTextClickableColor = "calculated";
17517 this.activeTaskBorderColor = "calculated";
17518 this.activeTaskBkgColor = "calculated";
17519 this.gridColor = "calculated";
17520 this.doneTaskBkgColor = "calculated";
17521 this.doneTaskBorderColor = "calculated";
17522 this.critBorderColor = "calculated";
17523 this.critBkgColor = "calculated";
17524 this.todayLineColor = "calculated";
17525 this.sectionBkgColor = (0,rgba/* default */.Z)(102, 102, 255, 0.49);
17526 this.altSectionBkgColor = "white";
17527 this.sectionBkgColor2 = "#fff400";
17528 this.taskBorderColor = "#534fbc";
17529 this.taskBkgColor = "#8a90dd";
17530 this.taskTextLightColor = "white";
17531 this.taskTextColor = "calculated";
17532 this.taskTextDarkColor = "black";
17533 this.taskTextOutsideColor = "calculated";
17534 this.taskTextClickableColor = "#003163";
17535 this.activeTaskBorderColor = "#534fbc";
17536 this.activeTaskBkgColor = "#bfc7ff";
17537 this.gridColor = "lightgrey";
17538 this.doneTaskBkgColor = "lightgrey";
17539 this.doneTaskBorderColor = "grey";
17540 this.critBorderColor = "#ff8888";
17541 this.critBkgColor = "red";
17542 this.todayLineColor = "red";
17543 this.personBorder = this.primaryBorderColor;
17544 this.personBkg = this.mainBkg;
17545 this.archEdgeColor = "calculated";
17546 this.archEdgeArrowColor = "calculated";
17547 this.archEdgeWidth = "3";
17548 this.archGroupBorderColor = this.primaryBorderColor;
17549 this.archGroupBorderWidth = "2px";
17550 this.rowOdd = "calculated";
17551 this.rowEven = "calculated";
17552 this.labelColor = "black";
17553 this.errorBkgColor = "#552222";
17554 this.errorTextColor = "#552222";
17555 this.updateColors();
17556 }
17557 updateColors() {
17558 this.cScale0 = this.cScale0 || this.primaryColor;
17559 this.cScale1 = this.cScale1 || this.secondaryColor;
17560 this.cScale2 = this.cScale2 || this.tertiaryColor;
17561 this.cScale3 = this.cScale3 || methods_adjust(this.primaryColor, { h: 30 });
17562 this.cScale4 = this.cScale4 || methods_adjust(this.primaryColor, { h: 60 });
17563 this.cScale5 = this.cScale5 || methods_adjust(this.primaryColor, { h: 90 });
17564 this.cScale6 = this.cScale6 || methods_adjust(this.primaryColor, { h: 120 });
17565 this.cScale7 = this.cScale7 || methods_adjust(this.primaryColor, { h: 150 });
17566 this.cScale8 = this.cScale8 || methods_adjust(this.primaryColor, { h: 210 });
17567 this.cScale9 = this.cScale9 || methods_adjust(this.primaryColor, { h: 270 });
17568 this.cScale10 = this.cScale10 || methods_adjust(this.primaryColor, { h: 300 });
17569 this.cScale11 = this.cScale11 || methods_adjust(this.primaryColor, { h: 330 });
17570 this["cScalePeer1"] = this["cScalePeer1"] || (0,darken/* default */.Z)(this.secondaryColor, 45);
17571 this["cScalePeer2"] = this["cScalePeer2"] || (0,darken/* default */.Z)(this.tertiaryColor, 40);
17572 for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
17573 this["cScale" + i] = (0,darken/* default */.Z)(this["cScale" + i], 10);
17574 this["cScalePeer" + i] = this["cScalePeer" + i] || (0,darken/* default */.Z)(this["cScale" + i], 25);
17575 }
17576 for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
17577 this["cScaleInv" + i] = this["cScaleInv" + i] || methods_adjust(this["cScale" + i], { h: 180 });
17578 }
17579 for (let i = 0; i < 5; i++) {
17580 this["surface" + i] = this["surface" + i] || methods_adjust(this.mainBkg, { h: 30, l: -(5 + i * 5) });
17581 this["surfacePeer" + i] = this["surfacePeer" + i] || methods_adjust(this.mainBkg, { h: 30, l: -(7 + i * 5) });
17582 }
17583 this.scaleLabelColor = this.scaleLabelColor !== "calculated" && this.scaleLabelColor ? this.scaleLabelColor : this.labelTextColor;
17584 if (this.labelTextColor !== "calculated") {
17585 this.cScaleLabel0 = this.cScaleLabel0 || methods_invert(this.labelTextColor);
17586 this.cScaleLabel3 = this.cScaleLabel3 || methods_invert(this.labelTextColor);
17587 for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
17588 this["cScaleLabel" + i] = this["cScaleLabel" + i] || this.labelTextColor;
17589 }
17590 }
17591 this.nodeBkg = this.mainBkg;
17592 this.nodeBorder = this.border1;
17593 this.clusterBkg = this.secondBkg;
17594 this.clusterBorder = this.border2;
17595 this.defaultLinkColor = this.lineColor;
17596 this.titleColor = this.textColor;
17597 this.edgeLabelBackground = this.labelBackground;
17598 this.actorBorder = (0,lighten/* default */.Z)(this.border1, 23);
17599 this.actorBkg = this.mainBkg;
17600 this.labelBoxBkgColor = this.actorBkg;
17601 this.signalColor = this.textColor;
17602 this.signalTextColor = this.textColor;
17603 this.labelBoxBorderColor = this.actorBorder;
17604 this.labelTextColor = this.actorTextColor;
17605 this.loopTextColor = this.actorTextColor;
17606 this.noteBorderColor = this.border2;
17607 this.noteTextColor = this.actorTextColor;
17608 this.actorLineColor = this.actorBorder;
17609 this.taskTextColor = this.taskTextLightColor;
17610 this.taskTextOutsideColor = this.taskTextDarkColor;
17611 this.archEdgeColor = this.lineColor;
17612 this.archEdgeArrowColor = this.lineColor;
17613 this.rowOdd = this.rowOdd || (0,lighten/* default */.Z)(this.primaryColor, 75) || "#ffffff";
17614 this.rowEven = this.rowEven || (0,lighten/* default */.Z)(this.primaryColor, 1);
17615 this.transitionColor = this.transitionColor || this.lineColor;
17616 this.transitionLabelColor = this.transitionLabelColor || this.textColor;
17617 this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor;
17618 this.stateBkg = this.stateBkg || this.mainBkg;
17619 this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg;
17620 this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor;
17621 this.altBackground = this.altBackground || "#f0f0f0";
17622 this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg;
17623 this.compositeBorder = this.compositeBorder || this.nodeBorder;
17624 this.innerEndBackground = this.nodeBorder;
17625 this.specialStateColor = this.lineColor;
17626 this.errorBkgColor = this.errorBkgColor || this.tertiaryColor;
17627 this.errorTextColor = this.errorTextColor || this.tertiaryTextColor;
17628 this.transitionColor = this.transitionColor || this.lineColor;
17629 this.classText = this.primaryTextColor;
17630 this.fillType0 = this.primaryColor;
17631 this.fillType1 = this.secondaryColor;
17632 this.fillType2 = methods_adjust(this.primaryColor, { h: 64 });
17633 this.fillType3 = methods_adjust(this.secondaryColor, { h: 64 });
17634 this.fillType4 = methods_adjust(this.primaryColor, { h: -64 });
17635 this.fillType5 = methods_adjust(this.secondaryColor, { h: -64 });
17636 this.fillType6 = methods_adjust(this.primaryColor, { h: 128 });
17637 this.fillType7 = methods_adjust(this.secondaryColor, { h: 128 });
17638 this.pie1 = this.pie1 || this.primaryColor;
17639 this.pie2 = this.pie2 || this.secondaryColor;
17640 this.pie3 = this.pie3 || methods_adjust(this.tertiaryColor, { l: -40 });
17641 this.pie4 = this.pie4 || methods_adjust(this.primaryColor, { l: -10 });
17642 this.pie5 = this.pie5 || methods_adjust(this.secondaryColor, { l: -30 });
17643 this.pie6 = this.pie6 || methods_adjust(this.tertiaryColor, { l: -20 });
17644 this.pie7 = this.pie7 || methods_adjust(this.primaryColor, { h: 60, l: -20 });
17645 this.pie8 = this.pie8 || methods_adjust(this.primaryColor, { h: -60, l: -40 });
17646 this.pie9 = this.pie9 || methods_adjust(this.primaryColor, { h: 120, l: -40 });
17647 this.pie10 = this.pie10 || methods_adjust(this.primaryColor, { h: 60, l: -40 });
17648 this.pie11 = this.pie11 || methods_adjust(this.primaryColor, { h: -90, l: -40 });
17649 this.pie12 = this.pie12 || methods_adjust(this.primaryColor, { h: 120, l: -30 });
17650 this.pieTitleTextSize = this.pieTitleTextSize || "25px";
17651 this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;
17652 this.pieSectionTextSize = this.pieSectionTextSize || "17px";
17653 this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;
17654 this.pieLegendTextSize = this.pieLegendTextSize || "17px";
17655 this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;
17656 this.pieStrokeColor = this.pieStrokeColor || "black";
17657 this.pieStrokeWidth = this.pieStrokeWidth || "2px";
17658 this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px";
17659 this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black";
17660 this.pieOpacity = this.pieOpacity || "0.7";
17661 this.quadrant1Fill = this.quadrant1Fill || this.primaryColor;
17662 this.quadrant2Fill = this.quadrant2Fill || methods_adjust(this.primaryColor, { r: 5, g: 5, b: 5 });
17663 this.quadrant3Fill = this.quadrant3Fill || methods_adjust(this.primaryColor, { r: 10, g: 10, b: 10 });
17664 this.quadrant4Fill = this.quadrant4Fill || methods_adjust(this.primaryColor, { r: 15, g: 15, b: 15 });
17665 this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor;
17666 this.quadrant2TextFill = this.quadrant2TextFill || methods_adjust(this.primaryTextColor, { r: -5, g: -5, b: -5 });
17667 this.quadrant3TextFill = this.quadrant3TextFill || methods_adjust(this.primaryTextColor, { r: -10, g: -10, b: -10 });
17668 this.quadrant4TextFill = this.quadrant4TextFill || methods_adjust(this.primaryTextColor, { r: -15, g: -15, b: -15 });
17669 this.quadrantPointFill = this.quadrantPointFill || (0,is_dark/* default */.Z)(this.quadrant1Fill) ? (0,lighten/* default */.Z)(this.quadrant1Fill) : (0,darken/* default */.Z)(this.quadrant1Fill);
17670 this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor;
17671 this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor;
17672 this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor;
17673 this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor;
17674 this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor;
17675 this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor;
17676 this.radar = {
17677 axisColor: this.radar?.axisColor || this.lineColor,
17678 axisStrokeWidth: this.radar?.axisStrokeWidth || 2,
17679 axisLabelFontSize: this.radar?.axisLabelFontSize || 12,
17680 curveOpacity: this.radar?.curveOpacity || 0.5,
17681 curveStrokeWidth: this.radar?.curveStrokeWidth || 2,
17682 graticuleColor: this.radar?.graticuleColor || "#DEDEDE",
17683 graticuleStrokeWidth: this.radar?.graticuleStrokeWidth || 1,
17684 graticuleOpacity: this.radar?.graticuleOpacity || 0.3,
17685 legendBoxSize: this.radar?.legendBoxSize || 12,
17686 legendFontSize: this.radar?.legendFontSize || 12
17687 };
17688 this.xyChart = {
17689 backgroundColor: this.xyChart?.backgroundColor || this.background,
17690 titleColor: this.xyChart?.titleColor || this.primaryTextColor,
17691 xAxisTitleColor: this.xyChart?.xAxisTitleColor || this.primaryTextColor,
17692 xAxisLabelColor: this.xyChart?.xAxisLabelColor || this.primaryTextColor,
17693 xAxisTickColor: this.xyChart?.xAxisTickColor || this.primaryTextColor,
17694 xAxisLineColor: this.xyChart?.xAxisLineColor || this.primaryTextColor,
17695 yAxisTitleColor: this.xyChart?.yAxisTitleColor || this.primaryTextColor,
17696 yAxisLabelColor: this.xyChart?.yAxisLabelColor || this.primaryTextColor,
17697 yAxisTickColor: this.xyChart?.yAxisTickColor || this.primaryTextColor,
17698 yAxisLineColor: this.xyChart?.yAxisLineColor || this.primaryTextColor,
17699 plotColorPalette: this.xyChart?.plotColorPalette || "#ECECFF,#8493A6,#FFC3A0,#DCDDE1,#B8E994,#D1A36F,#C3CDE6,#FFB6C1,#496078,#F8F3E3"
17700 };
17701 this.requirementBackground = this.requirementBackground || this.primaryColor;
17702 this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor;
17703 this.requirementBorderSize = this.requirementBorderSize || "1";
17704 this.requirementTextColor = this.requirementTextColor || this.primaryTextColor;
17705 this.relationColor = this.relationColor || this.lineColor;
17706 this.relationLabelBackground = this.relationLabelBackground || this.labelBackground;
17707 this.relationLabelColor = this.relationLabelColor || this.actorTextColor;
17708 this.git0 = this.git0 || this.primaryColor;
17709 this.git1 = this.git1 || this.secondaryColor;
17710 this.git2 = this.git2 || this.tertiaryColor;
17711 this.git3 = this.git3 || methods_adjust(this.primaryColor, { h: -30 });
17712 this.git4 = this.git4 || methods_adjust(this.primaryColor, { h: -60 });
17713 this.git5 = this.git5 || methods_adjust(this.primaryColor, { h: -90 });
17714 this.git6 = this.git6 || methods_adjust(this.primaryColor, { h: 60 });
17715 this.git7 = this.git7 || methods_adjust(this.primaryColor, { h: 120 });
17716 if (this.darkMode) {
17717 this.git0 = (0,lighten/* default */.Z)(this.git0, 25);
17718 this.git1 = (0,lighten/* default */.Z)(this.git1, 25);
17719 this.git2 = (0,lighten/* default */.Z)(this.git2, 25);
17720 this.git3 = (0,lighten/* default */.Z)(this.git3, 25);
17721 this.git4 = (0,lighten/* default */.Z)(this.git4, 25);
17722 this.git5 = (0,lighten/* default */.Z)(this.git5, 25);
17723 this.git6 = (0,lighten/* default */.Z)(this.git6, 25);
17724 this.git7 = (0,lighten/* default */.Z)(this.git7, 25);
17725 } else {
17726 this.git0 = (0,darken/* default */.Z)(this.git0, 25);
17727 this.git1 = (0,darken/* default */.Z)(this.git1, 25);
17728 this.git2 = (0,darken/* default */.Z)(this.git2, 25);
17729 this.git3 = (0,darken/* default */.Z)(this.git3, 25);
17730 this.git4 = (0,darken/* default */.Z)(this.git4, 25);
17731 this.git5 = (0,darken/* default */.Z)(this.git5, 25);
17732 this.git6 = (0,darken/* default */.Z)(this.git6, 25);
17733 this.git7 = (0,darken/* default */.Z)(this.git7, 25);
17734 }
17735 this.gitInv0 = this.gitInv0 || (0,darken/* default */.Z)(methods_invert(this.git0), 25);
17736 this.gitInv1 = this.gitInv1 || methods_invert(this.git1);
17737 this.gitInv2 = this.gitInv2 || methods_invert(this.git2);
17738 this.gitInv3 = this.gitInv3 || methods_invert(this.git3);
17739 this.gitInv4 = this.gitInv4 || methods_invert(this.git4);
17740 this.gitInv5 = this.gitInv5 || methods_invert(this.git5);
17741 this.gitInv6 = this.gitInv6 || methods_invert(this.git6);
17742 this.gitInv7 = this.gitInv7 || methods_invert(this.git7);
17743 this.gitBranchLabel0 = this.gitBranchLabel0 || methods_invert(this.labelTextColor);
17744 this.gitBranchLabel1 = this.gitBranchLabel1 || this.labelTextColor;
17745 this.gitBranchLabel2 = this.gitBranchLabel2 || this.labelTextColor;
17746 this.gitBranchLabel3 = this.gitBranchLabel3 || methods_invert(this.labelTextColor);
17747 this.gitBranchLabel4 = this.gitBranchLabel4 || this.labelTextColor;
17748 this.gitBranchLabel5 = this.gitBranchLabel5 || this.labelTextColor;
17749 this.gitBranchLabel6 = this.gitBranchLabel6 || this.labelTextColor;
17750 this.gitBranchLabel7 = this.gitBranchLabel7 || this.labelTextColor;
17751 this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;
17752 this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;
17753 this.tagLabelBorder = this.tagBorder || this.primaryBorderColor;
17754 this.tagLabelFontSize = this.tagLabelFontSize || "10px";
17755 this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor;
17756 this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor;
17757 this.commitLabelFontSize = this.commitLabelFontSize || "10px";
17758 this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || oldAttributeBackgroundColorOdd;
17759 this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || oldAttributeBackgroundColorEven;
17760 }
17761 calculate(overrides) {
17762 Object.keys(this).forEach((k) => {
17763 if (this[k] === "calculated") {
17764 this[k] = void 0;
17765 }
17766 });
17767 if (typeof overrides !== "object") {
17768 this.updateColors();
17769 return;
17770 }
17771 const keys = Object.keys(overrides);
17772 keys.forEach((k) => {
17773 this[k] = overrides[k];
17774 });
17775 this.updateColors();
17776 keys.forEach((k) => {
17777 this[k] = overrides[k];
17778 });
17779 }
17780 };
17781 var getThemeVariables3 = /* @__PURE__ */ __name((userOverrides) => {
17782 const theme = new Theme3();
17783 theme.calculate(userOverrides);
17784 return theme;
17785 }, "getThemeVariables");
17786
17787 // src/themes/theme-forest.js
17788
17789 var Theme4 = class {
17790 static {
17791 __name(this, "Theme");
17792 }
17793 constructor() {
17794 this.background = "#f4f4f4";
17795 this.primaryColor = "#cde498";
17796 this.secondaryColor = "#cdffb2";
17797 this.background = "white";
17798 this.mainBkg = "#cde498";
17799 this.secondBkg = "#cdffb2";
17800 this.lineColor = "green";
17801 this.border1 = "#13540c";
17802 this.border2 = "#6eaa49";
17803 this.arrowheadColor = "green";
17804 this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif';
17805 this.fontSize = "16px";
17806 this.tertiaryColor = (0,lighten/* default */.Z)("#cde498", 10);
17807 this.primaryBorderColor = mkBorder(this.primaryColor, this.darkMode);
17808 this.secondaryBorderColor = mkBorder(this.secondaryColor, this.darkMode);
17809 this.tertiaryBorderColor = mkBorder(this.tertiaryColor, this.darkMode);
17810 this.primaryTextColor = methods_invert(this.primaryColor);
17811 this.secondaryTextColor = methods_invert(this.secondaryColor);
17812 this.tertiaryTextColor = methods_invert(this.primaryColor);
17813 this.lineColor = methods_invert(this.background);
17814 this.textColor = methods_invert(this.background);
17815 this.THEME_COLOR_LIMIT = 12;
17816 this.nodeBkg = "calculated";
17817 this.nodeBorder = "calculated";
17818 this.clusterBkg = "calculated";
17819 this.clusterBorder = "calculated";
17820 this.defaultLinkColor = "calculated";
17821 this.titleColor = "#333";
17822 this.edgeLabelBackground = "#e8e8e8";
17823 this.actorBorder = "calculated";
17824 this.actorBkg = "calculated";
17825 this.actorTextColor = "black";
17826 this.actorLineColor = "calculated";
17827 this.signalColor = "#333";
17828 this.signalTextColor = "#333";
17829 this.labelBoxBkgColor = "calculated";
17830 this.labelBoxBorderColor = "#326932";
17831 this.labelTextColor = "calculated";
17832 this.loopTextColor = "calculated";
17833 this.noteBorderColor = "calculated";
17834 this.noteBkgColor = "#fff5ad";
17835 this.noteTextColor = "calculated";
17836 this.activationBorderColor = "#666";
17837 this.activationBkgColor = "#f4f4f4";
17838 this.sequenceNumberColor = "white";
17839 this.sectionBkgColor = "#6eaa49";
17840 this.altSectionBkgColor = "white";
17841 this.sectionBkgColor2 = "#6eaa49";
17842 this.excludeBkgColor = "#eeeeee";
17843 this.taskBorderColor = "calculated";
17844 this.taskBkgColor = "#487e3a";
17845 this.taskTextLightColor = "white";
17846 this.taskTextColor = "calculated";
17847 this.taskTextDarkColor = "black";
17848 this.taskTextOutsideColor = "calculated";
17849 this.taskTextClickableColor = "#003163";
17850 this.activeTaskBorderColor = "calculated";
17851 this.activeTaskBkgColor = "calculated";
17852 this.gridColor = "lightgrey";
17853 this.doneTaskBkgColor = "lightgrey";
17854 this.doneTaskBorderColor = "grey";
17855 this.critBorderColor = "#ff8888";
17856 this.critBkgColor = "red";
17857 this.todayLineColor = "red";
17858 this.personBorder = this.primaryBorderColor;
17859 this.personBkg = this.mainBkg;
17860 this.archEdgeColor = "calculated";
17861 this.archEdgeArrowColor = "calculated";
17862 this.archEdgeWidth = "3";
17863 this.archGroupBorderColor = this.primaryBorderColor;
17864 this.archGroupBorderWidth = "2px";
17865 this.labelColor = "black";
17866 this.errorBkgColor = "#552222";
17867 this.errorTextColor = "#552222";
17868 }
17869 updateColors() {
17870 this.actorBorder = (0,darken/* default */.Z)(this.mainBkg, 20);
17871 this.actorBkg = this.mainBkg;
17872 this.labelBoxBkgColor = this.actorBkg;
17873 this.labelTextColor = this.actorTextColor;
17874 this.loopTextColor = this.actorTextColor;
17875 this.noteBorderColor = this.border2;
17876 this.noteTextColor = this.actorTextColor;
17877 this.actorLineColor = this.actorBorder;
17878 this.cScale0 = this.cScale0 || this.primaryColor;
17879 this.cScale1 = this.cScale1 || this.secondaryColor;
17880 this.cScale2 = this.cScale2 || this.tertiaryColor;
17881 this.cScale3 = this.cScale3 || methods_adjust(this.primaryColor, { h: 30 });
17882 this.cScale4 = this.cScale4 || methods_adjust(this.primaryColor, { h: 60 });
17883 this.cScale5 = this.cScale5 || methods_adjust(this.primaryColor, { h: 90 });
17884 this.cScale6 = this.cScale6 || methods_adjust(this.primaryColor, { h: 120 });
17885 this.cScale7 = this.cScale7 || methods_adjust(this.primaryColor, { h: 150 });
17886 this.cScale8 = this.cScale8 || methods_adjust(this.primaryColor, { h: 210 });
17887 this.cScale9 = this.cScale9 || methods_adjust(this.primaryColor, { h: 270 });
17888 this.cScale10 = this.cScale10 || methods_adjust(this.primaryColor, { h: 300 });
17889 this.cScale11 = this.cScale11 || methods_adjust(this.primaryColor, { h: 330 });
17890 this["cScalePeer1"] = this["cScalePeer1"] || (0,darken/* default */.Z)(this.secondaryColor, 45);
17891 this["cScalePeer2"] = this["cScalePeer2"] || (0,darken/* default */.Z)(this.tertiaryColor, 40);
17892 for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
17893 this["cScale" + i] = (0,darken/* default */.Z)(this["cScale" + i], 10);
17894 this["cScalePeer" + i] = this["cScalePeer" + i] || (0,darken/* default */.Z)(this["cScale" + i], 25);
17895 }
17896 for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
17897 this["cScaleInv" + i] = this["cScaleInv" + i] || methods_adjust(this["cScale" + i], { h: 180 });
17898 }
17899 this.scaleLabelColor = this.scaleLabelColor !== "calculated" && this.scaleLabelColor ? this.scaleLabelColor : this.labelTextColor;
17900 for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
17901 this["cScaleLabel" + i] = this["cScaleLabel" + i] || this.scaleLabelColor;
17902 }
17903 for (let i = 0; i < 5; i++) {
17904 this["surface" + i] = this["surface" + i] || methods_adjust(this.mainBkg, { h: 30, s: -30, l: -(5 + i * 5) });
17905 this["surfacePeer" + i] = this["surfacePeer" + i] || methods_adjust(this.mainBkg, { h: 30, s: -30, l: -(8 + i * 5) });
17906 }
17907 this.nodeBkg = this.mainBkg;
17908 this.nodeBorder = this.border1;
17909 this.clusterBkg = this.secondBkg;
17910 this.clusterBorder = this.border2;
17911 this.defaultLinkColor = this.lineColor;
17912 this.taskBorderColor = this.border1;
17913 this.taskTextColor = this.taskTextLightColor;
17914 this.taskTextOutsideColor = this.taskTextDarkColor;
17915 this.activeTaskBorderColor = this.taskBorderColor;
17916 this.activeTaskBkgColor = this.mainBkg;
17917 this.archEdgeColor = this.lineColor;
17918 this.archEdgeArrowColor = this.lineColor;
17919 this.rowOdd = this.rowOdd || (0,lighten/* default */.Z)(this.mainBkg, 75) || "#ffffff";
17920 this.rowEven = this.rowEven || (0,lighten/* default */.Z)(this.mainBkg, 20);
17921 this.transitionColor = this.transitionColor || this.lineColor;
17922 this.transitionLabelColor = this.transitionLabelColor || this.textColor;
17923 this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor;
17924 this.stateBkg = this.stateBkg || this.mainBkg;
17925 this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg;
17926 this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor;
17927 this.altBackground = this.altBackground || "#f0f0f0";
17928 this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg;
17929 this.compositeBorder = this.compositeBorder || this.nodeBorder;
17930 this.innerEndBackground = this.primaryBorderColor;
17931 this.specialStateColor = this.lineColor;
17932 this.errorBkgColor = this.errorBkgColor || this.tertiaryColor;
17933 this.errorTextColor = this.errorTextColor || this.tertiaryTextColor;
17934 this.transitionColor = this.transitionColor || this.lineColor;
17935 this.classText = this.primaryTextColor;
17936 this.fillType0 = this.primaryColor;
17937 this.fillType1 = this.secondaryColor;
17938 this.fillType2 = methods_adjust(this.primaryColor, { h: 64 });
17939 this.fillType3 = methods_adjust(this.secondaryColor, { h: 64 });
17940 this.fillType4 = methods_adjust(this.primaryColor, { h: -64 });
17941 this.fillType5 = methods_adjust(this.secondaryColor, { h: -64 });
17942 this.fillType6 = methods_adjust(this.primaryColor, { h: 128 });
17943 this.fillType7 = methods_adjust(this.secondaryColor, { h: 128 });
17944 this.pie1 = this.pie1 || this.primaryColor;
17945 this.pie2 = this.pie2 || this.secondaryColor;
17946 this.pie3 = this.pie3 || this.tertiaryColor;
17947 this.pie4 = this.pie4 || methods_adjust(this.primaryColor, { l: -30 });
17948 this.pie5 = this.pie5 || methods_adjust(this.secondaryColor, { l: -30 });
17949 this.pie6 = this.pie6 || methods_adjust(this.tertiaryColor, { h: 40, l: -40 });
17950 this.pie7 = this.pie7 || methods_adjust(this.primaryColor, { h: 60, l: -10 });
17951 this.pie8 = this.pie8 || methods_adjust(this.primaryColor, { h: -60, l: -10 });
17952 this.pie9 = this.pie9 || methods_adjust(this.primaryColor, { h: 120, l: 0 });
17953 this.pie10 = this.pie10 || methods_adjust(this.primaryColor, { h: 60, l: -50 });
17954 this.pie11 = this.pie11 || methods_adjust(this.primaryColor, { h: -60, l: -50 });
17955 this.pie12 = this.pie12 || methods_adjust(this.primaryColor, { h: 120, l: -50 });
17956 this.pieTitleTextSize = this.pieTitleTextSize || "25px";
17957 this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;
17958 this.pieSectionTextSize = this.pieSectionTextSize || "17px";
17959 this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;
17960 this.pieLegendTextSize = this.pieLegendTextSize || "17px";
17961 this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;
17962 this.pieStrokeColor = this.pieStrokeColor || "black";
17963 this.pieStrokeWidth = this.pieStrokeWidth || "2px";
17964 this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px";
17965 this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black";
17966 this.pieOpacity = this.pieOpacity || "0.7";
17967 this.quadrant1Fill = this.quadrant1Fill || this.primaryColor;
17968 this.quadrant2Fill = this.quadrant2Fill || methods_adjust(this.primaryColor, { r: 5, g: 5, b: 5 });
17969 this.quadrant3Fill = this.quadrant3Fill || methods_adjust(this.primaryColor, { r: 10, g: 10, b: 10 });
17970 this.quadrant4Fill = this.quadrant4Fill || methods_adjust(this.primaryColor, { r: 15, g: 15, b: 15 });
17971 this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor;
17972 this.quadrant2TextFill = this.quadrant2TextFill || methods_adjust(this.primaryTextColor, { r: -5, g: -5, b: -5 });
17973 this.quadrant3TextFill = this.quadrant3TextFill || methods_adjust(this.primaryTextColor, { r: -10, g: -10, b: -10 });
17974 this.quadrant4TextFill = this.quadrant4TextFill || methods_adjust(this.primaryTextColor, { r: -15, g: -15, b: -15 });
17975 this.quadrantPointFill = this.quadrantPointFill || (0,is_dark/* default */.Z)(this.quadrant1Fill) ? (0,lighten/* default */.Z)(this.quadrant1Fill) : (0,darken/* default */.Z)(this.quadrant1Fill);
17976 this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor;
17977 this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor;
17978 this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor;
17979 this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor;
17980 this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor;
17981 this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor;
17982 this.packet = {
17983 startByteColor: this.primaryTextColor,
17984 endByteColor: this.primaryTextColor,
17985 labelColor: this.primaryTextColor,
17986 titleColor: this.primaryTextColor,
17987 blockStrokeColor: this.primaryTextColor,
17988 blockFillColor: this.mainBkg
17989 };
17990 this.radar = {
17991 axisColor: this.radar?.axisColor || this.lineColor,
17992 axisStrokeWidth: this.radar?.axisStrokeWidth || 2,
17993 axisLabelFontSize: this.radar?.axisLabelFontSize || 12,
17994 curveOpacity: this.radar?.curveOpacity || 0.5,
17995 curveStrokeWidth: this.radar?.curveStrokeWidth || 2,
17996 graticuleColor: this.radar?.graticuleColor || "#DEDEDE",
17997 graticuleStrokeWidth: this.radar?.graticuleStrokeWidth || 1,
17998 graticuleOpacity: this.radar?.graticuleOpacity || 0.3,
17999 legendBoxSize: this.radar?.legendBoxSize || 12,
18000 legendFontSize: this.radar?.legendFontSize || 12
18001 };
18002 this.xyChart = {
18003 backgroundColor: this.xyChart?.backgroundColor || this.background,
18004 titleColor: this.xyChart?.titleColor || this.primaryTextColor,
18005 xAxisTitleColor: this.xyChart?.xAxisTitleColor || this.primaryTextColor,
18006 xAxisLabelColor: this.xyChart?.xAxisLabelColor || this.primaryTextColor,
18007 xAxisTickColor: this.xyChart?.xAxisTickColor || this.primaryTextColor,
18008 xAxisLineColor: this.xyChart?.xAxisLineColor || this.primaryTextColor,
18009 yAxisTitleColor: this.xyChart?.yAxisTitleColor || this.primaryTextColor,
18010 yAxisLabelColor: this.xyChart?.yAxisLabelColor || this.primaryTextColor,
18011 yAxisTickColor: this.xyChart?.yAxisTickColor || this.primaryTextColor,
18012 yAxisLineColor: this.xyChart?.yAxisLineColor || this.primaryTextColor,
18013 plotColorPalette: this.xyChart?.plotColorPalette || "#CDE498,#FF6B6B,#A0D2DB,#D7BDE2,#F0F0F0,#FFC3A0,#7FD8BE,#FF9A8B,#FAF3E0,#FFF176"
18014 };
18015 this.requirementBackground = this.requirementBackground || this.primaryColor;
18016 this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor;
18017 this.requirementBorderSize = this.requirementBorderSize || "1";
18018 this.requirementTextColor = this.requirementTextColor || this.primaryTextColor;
18019 this.relationColor = this.relationColor || this.lineColor;
18020 this.relationLabelBackground = this.relationLabelBackground || this.edgeLabelBackground;
18021 this.relationLabelColor = this.relationLabelColor || this.actorTextColor;
18022 this.git0 = this.git0 || this.primaryColor;
18023 this.git1 = this.git1 || this.secondaryColor;
18024 this.git2 = this.git2 || this.tertiaryColor;
18025 this.git3 = this.git3 || methods_adjust(this.primaryColor, { h: -30 });
18026 this.git4 = this.git4 || methods_adjust(this.primaryColor, { h: -60 });
18027 this.git5 = this.git5 || methods_adjust(this.primaryColor, { h: -90 });
18028 this.git6 = this.git6 || methods_adjust(this.primaryColor, { h: 60 });
18029 this.git7 = this.git7 || methods_adjust(this.primaryColor, { h: 120 });
18030 if (this.darkMode) {
18031 this.git0 = (0,lighten/* default */.Z)(this.git0, 25);
18032 this.git1 = (0,lighten/* default */.Z)(this.git1, 25);
18033 this.git2 = (0,lighten/* default */.Z)(this.git2, 25);
18034 this.git3 = (0,lighten/* default */.Z)(this.git3, 25);
18035 this.git4 = (0,lighten/* default */.Z)(this.git4, 25);
18036 this.git5 = (0,lighten/* default */.Z)(this.git5, 25);
18037 this.git6 = (0,lighten/* default */.Z)(this.git6, 25);
18038 this.git7 = (0,lighten/* default */.Z)(this.git7, 25);
18039 } else {
18040 this.git0 = (0,darken/* default */.Z)(this.git0, 25);
18041 this.git1 = (0,darken/* default */.Z)(this.git1, 25);
18042 this.git2 = (0,darken/* default */.Z)(this.git2, 25);
18043 this.git3 = (0,darken/* default */.Z)(this.git3, 25);
18044 this.git4 = (0,darken/* default */.Z)(this.git4, 25);
18045 this.git5 = (0,darken/* default */.Z)(this.git5, 25);
18046 this.git6 = (0,darken/* default */.Z)(this.git6, 25);
18047 this.git7 = (0,darken/* default */.Z)(this.git7, 25);
18048 }
18049 this.gitInv0 = this.gitInv0 || methods_invert(this.git0);
18050 this.gitInv1 = this.gitInv1 || methods_invert(this.git1);
18051 this.gitInv2 = this.gitInv2 || methods_invert(this.git2);
18052 this.gitInv3 = this.gitInv3 || methods_invert(this.git3);
18053 this.gitInv4 = this.gitInv4 || methods_invert(this.git4);
18054 this.gitInv5 = this.gitInv5 || methods_invert(this.git5);
18055 this.gitInv6 = this.gitInv6 || methods_invert(this.git6);
18056 this.gitInv7 = this.gitInv7 || methods_invert(this.git7);
18057 this.gitBranchLabel0 = this.gitBranchLabel0 || methods_invert(this.labelTextColor);
18058 this.gitBranchLabel1 = this.gitBranchLabel1 || this.labelTextColor;
18059 this.gitBranchLabel2 = this.gitBranchLabel2 || this.labelTextColor;
18060 this.gitBranchLabel3 = this.gitBranchLabel3 || methods_invert(this.labelTextColor);
18061 this.gitBranchLabel4 = this.gitBranchLabel4 || this.labelTextColor;
18062 this.gitBranchLabel5 = this.gitBranchLabel5 || this.labelTextColor;
18063 this.gitBranchLabel6 = this.gitBranchLabel6 || this.labelTextColor;
18064 this.gitBranchLabel7 = this.gitBranchLabel7 || this.labelTextColor;
18065 this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;
18066 this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;
18067 this.tagLabelBorder = this.tagBorder || this.primaryBorderColor;
18068 this.tagLabelFontSize = this.tagLabelFontSize || "10px";
18069 this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor;
18070 this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor;
18071 this.commitLabelFontSize = this.commitLabelFontSize || "10px";
18072 this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || oldAttributeBackgroundColorOdd;
18073 this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || oldAttributeBackgroundColorEven;
18074 }
18075 calculate(overrides) {
18076 if (typeof overrides !== "object") {
18077 this.updateColors();
18078 return;
18079 }
18080 const keys = Object.keys(overrides);
18081 keys.forEach((k) => {
18082 this[k] = overrides[k];
18083 });
18084 this.updateColors();
18085 keys.forEach((k) => {
18086 this[k] = overrides[k];
18087 });
18088 }
18089 };
18090 var getThemeVariables4 = /* @__PURE__ */ __name((userOverrides) => {
18091 const theme = new Theme4();
18092 theme.calculate(userOverrides);
18093 return theme;
18094 }, "getThemeVariables");
18095
18096 // src/themes/theme-neutral.js
18097
18098 var Theme5 = class {
18099 static {
18100 __name(this, "Theme");
18101 }
18102 constructor() {
18103 this.primaryColor = "#eee";
18104 this.contrast = "#707070";
18105 this.secondaryColor = (0,lighten/* default */.Z)(this.contrast, 55);
18106 this.background = "#ffffff";
18107 this.tertiaryColor = methods_adjust(this.primaryColor, { h: -160 });
18108 this.primaryBorderColor = mkBorder(this.primaryColor, this.darkMode);
18109 this.secondaryBorderColor = mkBorder(this.secondaryColor, this.darkMode);
18110 this.tertiaryBorderColor = mkBorder(this.tertiaryColor, this.darkMode);
18111 this.primaryTextColor = methods_invert(this.primaryColor);
18112 this.secondaryTextColor = methods_invert(this.secondaryColor);
18113 this.tertiaryTextColor = methods_invert(this.tertiaryColor);
18114 this.lineColor = methods_invert(this.background);
18115 this.textColor = methods_invert(this.background);
18116 this.mainBkg = "#eee";
18117 this.secondBkg = "calculated";
18118 this.lineColor = "#666";
18119 this.border1 = "#999";
18120 this.border2 = "calculated";
18121 this.note = "#ffa";
18122 this.text = "#333";
18123 this.critical = "#d42";
18124 this.done = "#bbb";
18125 this.arrowheadColor = "#333333";
18126 this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif';
18127 this.fontSize = "16px";
18128 this.THEME_COLOR_LIMIT = 12;
18129 this.nodeBkg = "calculated";
18130 this.nodeBorder = "calculated";
18131 this.clusterBkg = "calculated";
18132 this.clusterBorder = "calculated";
18133 this.defaultLinkColor = "calculated";
18134 this.titleColor = "calculated";
18135 this.edgeLabelBackground = "white";
18136 this.actorBorder = "calculated";
18137 this.actorBkg = "calculated";
18138 this.actorTextColor = "calculated";
18139 this.actorLineColor = this.actorBorder;
18140 this.signalColor = "calculated";
18141 this.signalTextColor = "calculated";
18142 this.labelBoxBkgColor = "calculated";
18143 this.labelBoxBorderColor = "calculated";
18144 this.labelTextColor = "calculated";
18145 this.loopTextColor = "calculated";
18146 this.noteBorderColor = "calculated";
18147 this.noteBkgColor = "calculated";
18148 this.noteTextColor = "calculated";
18149 this.activationBorderColor = "#666";
18150 this.activationBkgColor = "#f4f4f4";
18151 this.sequenceNumberColor = "white";
18152 this.sectionBkgColor = "calculated";
18153 this.altSectionBkgColor = "white";
18154 this.sectionBkgColor2 = "calculated";
18155 this.excludeBkgColor = "#eeeeee";
18156 this.taskBorderColor = "calculated";
18157 this.taskBkgColor = "calculated";
18158 this.taskTextLightColor = "white";
18159 this.taskTextColor = "calculated";
18160 this.taskTextDarkColor = "calculated";
18161 this.taskTextOutsideColor = "calculated";
18162 this.taskTextClickableColor = "#003163";
18163 this.activeTaskBorderColor = "calculated";
18164 this.activeTaskBkgColor = "calculated";
18165 this.gridColor = "calculated";
18166 this.doneTaskBkgColor = "calculated";
18167 this.doneTaskBorderColor = "calculated";
18168 this.critBkgColor = "calculated";
18169 this.critBorderColor = "calculated";
18170 this.todayLineColor = "calculated";
18171 this.personBorder = this.primaryBorderColor;
18172 this.personBkg = this.mainBkg;
18173 this.archEdgeColor = "calculated";
18174 this.archEdgeArrowColor = "calculated";
18175 this.archEdgeWidth = "3";
18176 this.archGroupBorderColor = this.primaryBorderColor;
18177 this.archGroupBorderWidth = "2px";
18178 this.rowOdd = this.rowOdd || (0,lighten/* default */.Z)(this.mainBkg, 75) || "#ffffff";
18179 this.rowEven = this.rowEven || "#f4f4f4";
18180 this.labelColor = "black";
18181 this.errorBkgColor = "#552222";
18182 this.errorTextColor = "#552222";
18183 }
18184 updateColors() {
18185 this.secondBkg = (0,lighten/* default */.Z)(this.contrast, 55);
18186 this.border2 = this.contrast;
18187 this.actorBorder = (0,lighten/* default */.Z)(this.border1, 23);
18188 this.actorBkg = this.mainBkg;
18189 this.actorTextColor = this.text;
18190 this.actorLineColor = this.actorBorder;
18191 this.signalColor = this.text;
18192 this.signalTextColor = this.text;
18193 this.labelBoxBkgColor = this.actorBkg;
18194 this.labelBoxBorderColor = this.actorBorder;
18195 this.labelTextColor = this.text;
18196 this.loopTextColor = this.text;
18197 this.noteBorderColor = "#999";
18198 this.noteBkgColor = "#666";
18199 this.noteTextColor = "#fff";
18200 this.cScale0 = this.cScale0 || "#555";
18201 this.cScale1 = this.cScale1 || "#F4F4F4";
18202 this.cScale2 = this.cScale2 || "#555";
18203 this.cScale3 = this.cScale3 || "#BBB";
18204 this.cScale4 = this.cScale4 || "#777";
18205 this.cScale5 = this.cScale5 || "#999";
18206 this.cScale6 = this.cScale6 || "#DDD";
18207 this.cScale7 = this.cScale7 || "#FFF";
18208 this.cScale8 = this.cScale8 || "#DDD";
18209 this.cScale9 = this.cScale9 || "#BBB";
18210 this.cScale10 = this.cScale10 || "#999";
18211 this.cScale11 = this.cScale11 || "#777";
18212 for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
18213 this["cScaleInv" + i] = this["cScaleInv" + i] || methods_invert(this["cScale" + i]);
18214 }
18215 for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
18216 if (this.darkMode) {
18217 this["cScalePeer" + i] = this["cScalePeer" + i] || (0,lighten/* default */.Z)(this["cScale" + i], 10);
18218 } else {
18219 this["cScalePeer" + i] = this["cScalePeer" + i] || (0,darken/* default */.Z)(this["cScale" + i], 10);
18220 }
18221 }
18222 this.scaleLabelColor = this.scaleLabelColor || (this.darkMode ? "black" : this.labelTextColor);
18223 this.cScaleLabel0 = this.cScaleLabel0 || this.cScale1;
18224 this.cScaleLabel2 = this.cScaleLabel2 || this.cScale1;
18225 for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
18226 this["cScaleLabel" + i] = this["cScaleLabel" + i] || this.scaleLabelColor;
18227 }
18228 for (let i = 0; i < 5; i++) {
18229 this["surface" + i] = this["surface" + i] || methods_adjust(this.mainBkg, { l: -(5 + i * 5) });
18230 this["surfacePeer" + i] = this["surfacePeer" + i] || methods_adjust(this.mainBkg, { l: -(8 + i * 5) });
18231 }
18232 this.nodeBkg = this.mainBkg;
18233 this.nodeBorder = this.border1;
18234 this.clusterBkg = this.secondBkg;
18235 this.clusterBorder = this.border2;
18236 this.defaultLinkColor = this.lineColor;
18237 this.titleColor = this.text;
18238 this.sectionBkgColor = (0,lighten/* default */.Z)(this.contrast, 30);
18239 this.sectionBkgColor2 = (0,lighten/* default */.Z)(this.contrast, 30);
18240 this.taskBorderColor = (0,darken/* default */.Z)(this.contrast, 10);
18241 this.taskBkgColor = this.contrast;
18242 this.taskTextColor = this.taskTextLightColor;
18243 this.taskTextDarkColor = this.text;
18244 this.taskTextOutsideColor = this.taskTextDarkColor;
18245 this.activeTaskBorderColor = this.taskBorderColor;
18246 this.activeTaskBkgColor = this.mainBkg;
18247 this.gridColor = (0,lighten/* default */.Z)(this.border1, 30);
18248 this.doneTaskBkgColor = this.done;
18249 this.doneTaskBorderColor = this.lineColor;
18250 this.critBkgColor = this.critical;
18251 this.critBorderColor = (0,darken/* default */.Z)(this.critBkgColor, 10);
18252 this.todayLineColor = this.critBkgColor;
18253 this.archEdgeColor = this.lineColor;
18254 this.archEdgeArrowColor = this.lineColor;
18255 this.transitionColor = this.transitionColor || "#000";
18256 this.transitionLabelColor = this.transitionLabelColor || this.textColor;
18257 this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor;
18258 this.stateBkg = this.stateBkg || this.mainBkg;
18259 this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg;
18260 this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor;
18261 this.altBackground = this.altBackground || "#f4f4f4";
18262 this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg;
18263 this.stateBorder = this.stateBorder || "#000";
18264 this.innerEndBackground = this.primaryBorderColor;
18265 this.specialStateColor = "#222";
18266 this.errorBkgColor = this.errorBkgColor || this.tertiaryColor;
18267 this.errorTextColor = this.errorTextColor || this.tertiaryTextColor;
18268 this.classText = this.primaryTextColor;
18269 this.fillType0 = this.primaryColor;
18270 this.fillType1 = this.secondaryColor;
18271 this.fillType2 = methods_adjust(this.primaryColor, { h: 64 });
18272 this.fillType3 = methods_adjust(this.secondaryColor, { h: 64 });
18273 this.fillType4 = methods_adjust(this.primaryColor, { h: -64 });
18274 this.fillType5 = methods_adjust(this.secondaryColor, { h: -64 });
18275 this.fillType6 = methods_adjust(this.primaryColor, { h: 128 });
18276 this.fillType7 = methods_adjust(this.secondaryColor, { h: 128 });
18277 for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
18278 this["pie" + i] = this["cScale" + i];
18279 }
18280 this.pie12 = this.pie0;
18281 this.pieTitleTextSize = this.pieTitleTextSize || "25px";
18282 this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;
18283 this.pieSectionTextSize = this.pieSectionTextSize || "17px";
18284 this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;
18285 this.pieLegendTextSize = this.pieLegendTextSize || "17px";
18286 this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;
18287 this.pieStrokeColor = this.pieStrokeColor || "black";
18288 this.pieStrokeWidth = this.pieStrokeWidth || "2px";
18289 this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px";
18290 this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black";
18291 this.pieOpacity = this.pieOpacity || "0.7";
18292 this.quadrant1Fill = this.quadrant1Fill || this.primaryColor;
18293 this.quadrant2Fill = this.quadrant2Fill || methods_adjust(this.primaryColor, { r: 5, g: 5, b: 5 });
18294 this.quadrant3Fill = this.quadrant3Fill || methods_adjust(this.primaryColor, { r: 10, g: 10, b: 10 });
18295 this.quadrant4Fill = this.quadrant4Fill || methods_adjust(this.primaryColor, { r: 15, g: 15, b: 15 });
18296 this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor;
18297 this.quadrant2TextFill = this.quadrant2TextFill || methods_adjust(this.primaryTextColor, { r: -5, g: -5, b: -5 });
18298 this.quadrant3TextFill = this.quadrant3TextFill || methods_adjust(this.primaryTextColor, { r: -10, g: -10, b: -10 });
18299 this.quadrant4TextFill = this.quadrant4TextFill || methods_adjust(this.primaryTextColor, { r: -15, g: -15, b: -15 });
18300 this.quadrantPointFill = this.quadrantPointFill || (0,is_dark/* default */.Z)(this.quadrant1Fill) ? (0,lighten/* default */.Z)(this.quadrant1Fill) : (0,darken/* default */.Z)(this.quadrant1Fill);
18301 this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor;
18302 this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor;
18303 this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor;
18304 this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor;
18305 this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor;
18306 this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor;
18307 this.xyChart = {
18308 backgroundColor: this.xyChart?.backgroundColor || this.background,
18309 titleColor: this.xyChart?.titleColor || this.primaryTextColor,
18310 xAxisTitleColor: this.xyChart?.xAxisTitleColor || this.primaryTextColor,
18311 xAxisLabelColor: this.xyChart?.xAxisLabelColor || this.primaryTextColor,
18312 xAxisTickColor: this.xyChart?.xAxisTickColor || this.primaryTextColor,
18313 xAxisLineColor: this.xyChart?.xAxisLineColor || this.primaryTextColor,
18314 yAxisTitleColor: this.xyChart?.yAxisTitleColor || this.primaryTextColor,
18315 yAxisLabelColor: this.xyChart?.yAxisLabelColor || this.primaryTextColor,
18316 yAxisTickColor: this.xyChart?.yAxisTickColor || this.primaryTextColor,
18317 yAxisLineColor: this.xyChart?.yAxisLineColor || this.primaryTextColor,
18318 plotColorPalette: this.xyChart?.plotColorPalette || "#EEE,#6BB8E4,#8ACB88,#C7ACD6,#E8DCC2,#FFB2A8,#FFF380,#7E8D91,#FFD8B1,#FAF3E0"
18319 };
18320 this.radar = {
18321 axisColor: this.radar?.axisColor || this.lineColor,
18322 axisStrokeWidth: this.radar?.axisStrokeWidth || 2,
18323 axisLabelFontSize: this.radar?.axisLabelFontSize || 12,
18324 curveOpacity: this.radar?.curveOpacity || 0.5,
18325 curveStrokeWidth: this.radar?.curveStrokeWidth || 2,
18326 graticuleColor: this.radar?.graticuleColor || "#DEDEDE",
18327 graticuleStrokeWidth: this.radar?.graticuleStrokeWidth || 1,
18328 graticuleOpacity: this.radar?.graticuleOpacity || 0.3,
18329 legendBoxSize: this.radar?.legendBoxSize || 12,
18330 legendFontSize: this.radar?.legendFontSize || 12
18331 };
18332 this.requirementBackground = this.requirementBackground || this.primaryColor;
18333 this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor;
18334 this.requirementBorderSize = this.requirementBorderSize || "1";
18335 this.requirementTextColor = this.requirementTextColor || this.primaryTextColor;
18336 this.relationColor = this.relationColor || this.lineColor;
18337 this.relationLabelBackground = this.relationLabelBackground || this.edgeLabelBackground;
18338 this.relationLabelColor = this.relationLabelColor || this.actorTextColor;
18339 this.git0 = (0,darken/* default */.Z)(this.pie1, 25) || this.primaryColor;
18340 this.git1 = this.pie2 || this.secondaryColor;
18341 this.git2 = this.pie3 || this.tertiaryColor;
18342 this.git3 = this.pie4 || methods_adjust(this.primaryColor, { h: -30 });
18343 this.git4 = this.pie5 || methods_adjust(this.primaryColor, { h: -60 });
18344 this.git5 = this.pie6 || methods_adjust(this.primaryColor, { h: -90 });
18345 this.git6 = this.pie7 || methods_adjust(this.primaryColor, { h: 60 });
18346 this.git7 = this.pie8 || methods_adjust(this.primaryColor, { h: 120 });
18347 this.gitInv0 = this.gitInv0 || methods_invert(this.git0);
18348 this.gitInv1 = this.gitInv1 || methods_invert(this.git1);
18349 this.gitInv2 = this.gitInv2 || methods_invert(this.git2);
18350 this.gitInv3 = this.gitInv3 || methods_invert(this.git3);
18351 this.gitInv4 = this.gitInv4 || methods_invert(this.git4);
18352 this.gitInv5 = this.gitInv5 || methods_invert(this.git5);
18353 this.gitInv6 = this.gitInv6 || methods_invert(this.git6);
18354 this.gitInv7 = this.gitInv7 || methods_invert(this.git7);
18355 this.branchLabelColor = this.branchLabelColor || this.labelTextColor;
18356 this.gitBranchLabel0 = this.branchLabelColor;
18357 this.gitBranchLabel1 = "white";
18358 this.gitBranchLabel2 = this.branchLabelColor;
18359 this.gitBranchLabel3 = "white";
18360 this.gitBranchLabel4 = this.branchLabelColor;
18361 this.gitBranchLabel5 = this.branchLabelColor;
18362 this.gitBranchLabel6 = this.branchLabelColor;
18363 this.gitBranchLabel7 = this.branchLabelColor;
18364 this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;
18365 this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;
18366 this.tagLabelBorder = this.tagBorder || this.primaryBorderColor;
18367 this.tagLabelFontSize = this.tagLabelFontSize || "10px";
18368 this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor;
18369 this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor;
18370 this.commitLabelFontSize = this.commitLabelFontSize || "10px";
18371 this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || oldAttributeBackgroundColorOdd;
18372 this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || oldAttributeBackgroundColorEven;
18373 }
18374 calculate(overrides) {
18375 if (typeof overrides !== "object") {
18376 this.updateColors();
18377 return;
18378 }
18379 const keys = Object.keys(overrides);
18380 keys.forEach((k) => {
18381 this[k] = overrides[k];
18382 });
18383 this.updateColors();
18384 keys.forEach((k) => {
18385 this[k] = overrides[k];
18386 });
18387 }
18388 };
18389 var getThemeVariables5 = /* @__PURE__ */ __name((userOverrides) => {
18390 const theme = new Theme5();
18391 theme.calculate(userOverrides);
18392 return theme;
18393 }, "getThemeVariables");
18394
18395 // src/themes/index.js
18396 var themes_default = {
18397 base: {
18398 getThemeVariables
18399 },
18400 dark: {
18401 getThemeVariables: getThemeVariables2
18402 },
18403 default: {
18404 getThemeVariables: getThemeVariables3
18405 },
18406 forest: {
18407 getThemeVariables: getThemeVariables4
18408 },
18409 neutral: {
18410 getThemeVariables: getThemeVariables5
18411 }
18412 };
18413
18414 // src/schemas/config.schema.yaml?only-defaults=true
18415 var config_schema_default = {
18416 "flowchart": {
18417 "useMaxWidth": true,
18418 "titleTopMargin": 25,
18419 "subGraphTitleMargin": {
18420 "top": 0,
18421 "bottom": 0
18422 },
18423 "diagramPadding": 8,
18424 "htmlLabels": true,
18425 "nodeSpacing": 50,
18426 "rankSpacing": 50,
18427 "curve": "basis",
18428 "padding": 15,
18429 "defaultRenderer": "dagre-wrapper",
18430 "wrappingWidth": 200
18431 },
18432 "sequence": {
18433 "useMaxWidth": true,
18434 "hideUnusedParticipants": false,
18435 "activationWidth": 10,
18436 "diagramMarginX": 50,
18437 "diagramMarginY": 10,
18438 "actorMargin": 50,
18439 "width": 150,
18440 "height": 65,
18441 "boxMargin": 10,
18442 "boxTextMargin": 5,
18443 "noteMargin": 10,
18444 "messageMargin": 35,
18445 "messageAlign": "center",
18446 "mirrorActors": true,
18447 "forceMenus": false,
18448 "bottomMarginAdj": 1,
18449 "rightAngles": false,
18450 "showSequenceNumbers": false,
18451 "actorFontSize": 14,
18452 "actorFontFamily": '"Open Sans", sans-serif',
18453 "actorFontWeight": 400,
18454 "noteFontSize": 14,
18455 "noteFontFamily": '"trebuchet ms", verdana, arial, sans-serif',
18456 "noteFontWeight": 400,
18457 "noteAlign": "center",
18458 "messageFontSize": 16,
18459 "messageFontFamily": '"trebuchet ms", verdana, arial, sans-serif',
18460 "messageFontWeight": 400,
18461 "wrap": false,
18462 "wrapPadding": 10,
18463 "labelBoxWidth": 50,
18464 "labelBoxHeight": 20
18465 },
18466 "gantt": {
18467 "useMaxWidth": true,
18468 "titleTopMargin": 25,
18469 "barHeight": 20,
18470 "barGap": 4,
18471 "topPadding": 50,
18472 "rightPadding": 75,
18473 "leftPadding": 75,
18474 "gridLineStartPadding": 35,
18475 "fontSize": 11,
18476 "sectionFontSize": 11,
18477 "numberSectionStyles": 4,
18478 "axisFormat": "%Y-%m-%d",
18479 "topAxis": false,
18480 "displayMode": "",
18481 "weekday": "sunday"
18482 },
18483 "journey": {
18484 "useMaxWidth": true,
18485 "diagramMarginX": 50,
18486 "diagramMarginY": 10,
18487 "leftMargin": 150,
18488 "width": 150,
18489 "height": 50,
18490 "boxMargin": 10,
18491 "boxTextMargin": 5,
18492 "noteMargin": 10,
18493 "messageMargin": 35,
18494 "messageAlign": "center",
18495 "bottomMarginAdj": 1,
18496 "rightAngles": false,
18497 "taskFontSize": 14,
18498 "taskFontFamily": '"Open Sans", sans-serif',
18499 "taskMargin": 50,
18500 "activationWidth": 10,
18501 "textPlacement": "fo",
18502 "actorColours": [
18503 "#8FBC8F",
18504 "#7CFC00",
18505 "#00FFFF",
18506 "#20B2AA",
18507 "#B0E0E6",
18508 "#FFFFE0"
18509 ],
18510 "sectionFills": [
18511 "#191970",
18512 "#8B008B",
18513 "#4B0082",
18514 "#2F4F4F",
18515 "#800000",
18516 "#8B4513",
18517 "#00008B"
18518 ],
18519 "sectionColours": [
18520 "#fff"
18521 ]
18522 },
18523 "class": {
18524 "useMaxWidth": true,
18525 "titleTopMargin": 25,
18526 "arrowMarkerAbsolute": false,
18527 "dividerMargin": 10,
18528 "padding": 5,
18529 "textHeight": 10,
18530 "defaultRenderer": "dagre-wrapper",
18531 "htmlLabels": false,
18532 "hideEmptyMembersBox": false
18533 },
18534 "state": {
18535 "useMaxWidth": true,
18536 "titleTopMargin": 25,
18537 "dividerMargin": 10,
18538 "sizeUnit": 5,
18539 "padding": 8,
18540 "textHeight": 10,
18541 "titleShift": -15,
18542 "noteMargin": 10,
18543 "forkWidth": 70,
18544 "forkHeight": 7,
18545 "miniPadding": 2,
18546 "fontSizeFactor": 5.02,
18547 "fontSize": 24,
18548 "labelHeight": 16,
18549 "edgeLengthFactor": "20",
18550 "compositTitleSize": 35,
18551 "radius": 5,
18552 "defaultRenderer": "dagre-wrapper"
18553 },
18554 "er": {
18555 "useMaxWidth": true,
18556 "titleTopMargin": 25,
18557 "diagramPadding": 20,
18558 "layoutDirection": "TB",
18559 "minEntityWidth": 100,
18560 "minEntityHeight": 75,
18561 "entityPadding": 15,
18562 "nodeSpacing": 140,
18563 "rankSpacing": 80,
18564 "stroke": "gray",
18565 "fill": "honeydew",
18566 "fontSize": 12
18567 },
18568 "pie": {
18569 "useMaxWidth": true,
18570 "textPosition": 0.75
18571 },
18572 "quadrantChart": {
18573 "useMaxWidth": true,
18574 "chartWidth": 500,
18575 "chartHeight": 500,
18576 "titleFontSize": 20,
18577 "titlePadding": 10,
18578 "quadrantPadding": 5,
18579 "xAxisLabelPadding": 5,
18580 "yAxisLabelPadding": 5,
18581 "xAxisLabelFontSize": 16,
18582 "yAxisLabelFontSize": 16,
18583 "quadrantLabelFontSize": 16,
18584 "quadrantTextTopPadding": 5,
18585 "pointTextPadding": 5,
18586 "pointLabelFontSize": 12,
18587 "pointRadius": 5,
18588 "xAxisPosition": "top",
18589 "yAxisPosition": "left",
18590 "quadrantInternalBorderStrokeWidth": 1,
18591 "quadrantExternalBorderStrokeWidth": 2
18592 },
18593 "xyChart": {
18594 "useMaxWidth": true,
18595 "width": 700,
18596 "height": 500,
18597 "titleFontSize": 20,
18598 "titlePadding": 10,
18599 "showTitle": true,
18600 "xAxis": {
18601 "$ref": "#/$defs/XYChartAxisConfig",
18602 "showLabel": true,
18603 "labelFontSize": 14,
18604 "labelPadding": 5,
18605 "showTitle": true,
18606 "titleFontSize": 16,
18607 "titlePadding": 5,
18608 "showTick": true,
18609 "tickLength": 5,
18610 "tickWidth": 2,
18611 "showAxisLine": true,
18612 "axisLineWidth": 2
18613 },
18614 "yAxis": {
18615 "$ref": "#/$defs/XYChartAxisConfig",
18616 "showLabel": true,
18617 "labelFontSize": 14,
18618 "labelPadding": 5,
18619 "showTitle": true,
18620 "titleFontSize": 16,
18621 "titlePadding": 5,
18622 "showTick": true,
18623 "tickLength": 5,
18624 "tickWidth": 2,
18625 "showAxisLine": true,
18626 "axisLineWidth": 2
18627 },
18628 "chartOrientation": "vertical",
18629 "plotReservedSpacePercent": 50
18630 },
18631 "requirement": {
18632 "useMaxWidth": true,
18633 "rect_fill": "#f9f9f9",
18634 "text_color": "#333",
18635 "rect_border_size": "0.5px",
18636 "rect_border_color": "#bbb",
18637 "rect_min_width": 200,
18638 "rect_min_height": 200,
18639 "fontSize": 14,
18640 "rect_padding": 10,
18641 "line_height": 20
18642 },
18643 "mindmap": {
18644 "useMaxWidth": true,
18645 "padding": 10,
18646 "maxNodeWidth": 200
18647 },
18648 "kanban": {
18649 "useMaxWidth": true,
18650 "padding": 8,
18651 "sectionWidth": 200,
18652 "ticketBaseUrl": ""
18653 },
18654 "timeline": {
18655 "useMaxWidth": true,
18656 "diagramMarginX": 50,
18657 "diagramMarginY": 10,
18658 "leftMargin": 150,
18659 "width": 150,
18660 "height": 50,
18661 "boxMargin": 10,
18662 "boxTextMargin": 5,
18663 "noteMargin": 10,
18664 "messageMargin": 35,
18665 "messageAlign": "center",
18666 "bottomMarginAdj": 1,
18667 "rightAngles": false,
18668 "taskFontSize": 14,
18669 "taskFontFamily": '"Open Sans", sans-serif',
18670 "taskMargin": 50,
18671 "activationWidth": 10,
18672 "textPlacement": "fo",
18673 "actorColours": [
18674 "#8FBC8F",
18675 "#7CFC00",
18676 "#00FFFF",
18677 "#20B2AA",
18678 "#B0E0E6",
18679 "#FFFFE0"
18680 ],
18681 "sectionFills": [
18682 "#191970",
18683 "#8B008B",
18684 "#4B0082",
18685 "#2F4F4F",
18686 "#800000",
18687 "#8B4513",
18688 "#00008B"
18689 ],
18690 "sectionColours": [
18691 "#fff"
18692 ],
18693 "disableMulticolor": false
18694 },
18695 "gitGraph": {
18696 "useMaxWidth": true,
18697 "titleTopMargin": 25,
18698 "diagramPadding": 8,
18699 "nodeLabel": {
18700 "width": 75,
18701 "height": 100,
18702 "x": -25,
18703 "y": 0
18704 },
18705 "mainBranchName": "main",
18706 "mainBranchOrder": 0,
18707 "showCommitLabel": true,
18708 "showBranches": true,
18709 "rotateCommitLabel": true,
18710 "parallelCommits": false,
18711 "arrowMarkerAbsolute": false
18712 },
18713 "c4": {
18714 "useMaxWidth": true,
18715 "diagramMarginX": 50,
18716 "diagramMarginY": 10,
18717 "c4ShapeMargin": 50,
18718 "c4ShapePadding": 20,
18719 "width": 216,
18720 "height": 60,
18721 "boxMargin": 10,
18722 "c4ShapeInRow": 4,
18723 "nextLinePaddingX": 0,
18724 "c4BoundaryInRow": 2,
18725 "personFontSize": 14,
18726 "personFontFamily": '"Open Sans", sans-serif',
18727 "personFontWeight": "normal",
18728 "external_personFontSize": 14,
18729 "external_personFontFamily": '"Open Sans", sans-serif',
18730 "external_personFontWeight": "normal",
18731 "systemFontSize": 14,
18732 "systemFontFamily": '"Open Sans", sans-serif',
18733 "systemFontWeight": "normal",
18734 "external_systemFontSize": 14,
18735 "external_systemFontFamily": '"Open Sans", sans-serif',
18736 "external_systemFontWeight": "normal",
18737 "system_dbFontSize": 14,
18738 "system_dbFontFamily": '"Open Sans", sans-serif',
18739 "system_dbFontWeight": "normal",
18740 "external_system_dbFontSize": 14,
18741 "external_system_dbFontFamily": '"Open Sans", sans-serif',
18742 "external_system_dbFontWeight": "normal",
18743 "system_queueFontSize": 14,
18744 "system_queueFontFamily": '"Open Sans", sans-serif',
18745 "system_queueFontWeight": "normal",
18746 "external_system_queueFontSize": 14,
18747 "external_system_queueFontFamily": '"Open Sans", sans-serif',
18748 "external_system_queueFontWeight": "normal",
18749 "boundaryFontSize": 14,
18750 "boundaryFontFamily": '"Open Sans", sans-serif',
18751 "boundaryFontWeight": "normal",
18752 "messageFontSize": 12,
18753 "messageFontFamily": '"Open Sans", sans-serif',
18754 "messageFontWeight": "normal",
18755 "containerFontSize": 14,
18756 "containerFontFamily": '"Open Sans", sans-serif',
18757 "containerFontWeight": "normal",
18758 "external_containerFontSize": 14,
18759 "external_containerFontFamily": '"Open Sans", sans-serif',
18760 "external_containerFontWeight": "normal",
18761 "container_dbFontSize": 14,
18762 "container_dbFontFamily": '"Open Sans", sans-serif',
18763 "container_dbFontWeight": "normal",
18764 "external_container_dbFontSize": 14,
18765 "external_container_dbFontFamily": '"Open Sans", sans-serif',
18766 "external_container_dbFontWeight": "normal",
18767 "container_queueFontSize": 14,
18768 "container_queueFontFamily": '"Open Sans", sans-serif',
18769 "container_queueFontWeight": "normal",
18770 "external_container_queueFontSize": 14,
18771 "external_container_queueFontFamily": '"Open Sans", sans-serif',
18772 "external_container_queueFontWeight": "normal",
18773 "componentFontSize": 14,
18774 "componentFontFamily": '"Open Sans", sans-serif',
18775 "componentFontWeight": "normal",
18776 "external_componentFontSize": 14,
18777 "external_componentFontFamily": '"Open Sans", sans-serif',
18778 "external_componentFontWeight": "normal",
18779 "component_dbFontSize": 14,
18780 "component_dbFontFamily": '"Open Sans", sans-serif',
18781 "component_dbFontWeight": "normal",
18782 "external_component_dbFontSize": 14,
18783 "external_component_dbFontFamily": '"Open Sans", sans-serif',
18784 "external_component_dbFontWeight": "normal",
18785 "component_queueFontSize": 14,
18786 "component_queueFontFamily": '"Open Sans", sans-serif',
18787 "component_queueFontWeight": "normal",
18788 "external_component_queueFontSize": 14,
18789 "external_component_queueFontFamily": '"Open Sans", sans-serif',
18790 "external_component_queueFontWeight": "normal",
18791 "wrap": true,
18792 "wrapPadding": 10,
18793 "person_bg_color": "#08427B",
18794 "person_border_color": "#073B6F",
18795 "external_person_bg_color": "#686868",
18796 "external_person_border_color": "#8A8A8A",
18797 "system_bg_color": "#1168BD",
18798 "system_border_color": "#3C7FC0",
18799 "system_db_bg_color": "#1168BD",
18800 "system_db_border_color": "#3C7FC0",
18801 "system_queue_bg_color": "#1168BD",
18802 "system_queue_border_color": "#3C7FC0",
18803 "external_system_bg_color": "#999999",
18804 "external_system_border_color": "#8A8A8A",
18805 "external_system_db_bg_color": "#999999",
18806 "external_system_db_border_color": "#8A8A8A",
18807 "external_system_queue_bg_color": "#999999",
18808 "external_system_queue_border_color": "#8A8A8A",
18809 "container_bg_color": "#438DD5",
18810 "container_border_color": "#3C7FC0",
18811 "container_db_bg_color": "#438DD5",
18812 "container_db_border_color": "#3C7FC0",
18813 "container_queue_bg_color": "#438DD5",
18814 "container_queue_border_color": "#3C7FC0",
18815 "external_container_bg_color": "#B3B3B3",
18816 "external_container_border_color": "#A6A6A6",
18817 "external_container_db_bg_color": "#B3B3B3",
18818 "external_container_db_border_color": "#A6A6A6",
18819 "external_container_queue_bg_color": "#B3B3B3",
18820 "external_container_queue_border_color": "#A6A6A6",
18821 "component_bg_color": "#85BBF0",
18822 "component_border_color": "#78A8D8",
18823 "component_db_bg_color": "#85BBF0",
18824 "component_db_border_color": "#78A8D8",
18825 "component_queue_bg_color": "#85BBF0",
18826 "component_queue_border_color": "#78A8D8",
18827 "external_component_bg_color": "#CCCCCC",
18828 "external_component_border_color": "#BFBFBF",
18829 "external_component_db_bg_color": "#CCCCCC",
18830 "external_component_db_border_color": "#BFBFBF",
18831 "external_component_queue_bg_color": "#CCCCCC",
18832 "external_component_queue_border_color": "#BFBFBF"
18833 },
18834 "sankey": {
18835 "useMaxWidth": true,
18836 "width": 600,
18837 "height": 400,
18838 "linkColor": "gradient",
18839 "nodeAlignment": "justify",
18840 "showValues": true,
18841 "prefix": "",
18842 "suffix": ""
18843 },
18844 "block": {
18845 "useMaxWidth": true,
18846 "padding": 8
18847 },
18848 "packet": {
18849 "useMaxWidth": true,
18850 "rowHeight": 32,
18851 "bitWidth": 32,
18852 "bitsPerRow": 32,
18853 "showBits": true,
18854 "paddingX": 5,
18855 "paddingY": 5
18856 },
18857 "architecture": {
18858 "useMaxWidth": true,
18859 "padding": 40,
18860 "iconSize": 80,
18861 "fontSize": 16
18862 },
18863 "radar": {
18864 "useMaxWidth": true,
18865 "width": 600,
18866 "height": 600,
18867 "marginTop": 50,
18868 "marginRight": 50,
18869 "marginBottom": 50,
18870 "marginLeft": 50,
18871 "axisScaleFactor": 1,
18872 "axisLabelFactor": 1.05,
18873 "curveTension": 0.17
18874 },
18875 "theme": "default",
18876 "look": "classic",
18877 "handDrawnSeed": 0,
18878 "layout": "dagre",
18879 "maxTextSize": 5e4,
18880 "maxEdges": 500,
18881 "darkMode": false,
18882 "fontFamily": '"trebuchet ms", verdana, arial, sans-serif;',
18883 "logLevel": 5,
18884 "securityLevel": "strict",
18885 "startOnLoad": true,
18886 "arrowMarkerAbsolute": false,
18887 "secure": [
18888 "secure",
18889 "securityLevel",
18890 "startOnLoad",
18891 "maxTextSize",
18892 "suppressErrorRendering",
18893 "maxEdges"
18894 ],
18895 "legacyMathML": false,
18896 "forceLegacyMathML": false,
18897 "deterministicIds": false,
18898 "fontSize": 16,
18899 "markdownAutoWrap": true,
18900 "suppressErrorRendering": false
18901 };
18902
18903 // src/defaultConfig.ts
18904 var config = {
18905 ...config_schema_default,
18906 // Set, even though they're `undefined` so that `configKeys` finds these keys
18907 // TODO: Should we replace these with `null` so that they can go in the JSON Schema?
18908 deterministicIDSeed: void 0,
18909 elk: {
18910 // mergeEdges is needed here to be considered
18911 mergeEdges: false,
18912 nodePlacementStrategy: "BRANDES_KOEPF"
18913 },
18914 themeCSS: void 0,
18915 // add non-JSON default config values
18916 themeVariables: themes_default.default.getThemeVariables(),
18917 sequence: {
18918 ...config_schema_default.sequence,
18919 messageFont: /* @__PURE__ */ __name(function() {
18920 return {
18921 fontFamily: this.messageFontFamily,
18922 fontSize: this.messageFontSize,
18923 fontWeight: this.messageFontWeight
18924 };
18925 }, "messageFont"),
18926 noteFont: /* @__PURE__ */ __name(function() {
18927 return {
18928 fontFamily: this.noteFontFamily,
18929 fontSize: this.noteFontSize,
18930 fontWeight: this.noteFontWeight
18931 };
18932 }, "noteFont"),
18933 actorFont: /* @__PURE__ */ __name(function() {
18934 return {
18935 fontFamily: this.actorFontFamily,
18936 fontSize: this.actorFontSize,
18937 fontWeight: this.actorFontWeight
18938 };
18939 }, "actorFont")
18940 },
18941 class: {
18942 hideEmptyMembersBox: false
18943 },
18944 gantt: {
18945 ...config_schema_default.gantt,
18946 tickInterval: void 0,
18947 useWidth: void 0
18948 // can probably be removed since `configKeys` already includes this
18949 },
18950 c4: {
18951 ...config_schema_default.c4,
18952 useWidth: void 0,
18953 personFont: /* @__PURE__ */ __name(function() {
18954 return {
18955 fontFamily: this.personFontFamily,
18956 fontSize: this.personFontSize,
18957 fontWeight: this.personFontWeight
18958 };
18959 }, "personFont"),
18960 external_personFont: /* @__PURE__ */ __name(function() {
18961 return {
18962 fontFamily: this.external_personFontFamily,
18963 fontSize: this.external_personFontSize,
18964 fontWeight: this.external_personFontWeight
18965 };
18966 }, "external_personFont"),
18967 systemFont: /* @__PURE__ */ __name(function() {
18968 return {
18969 fontFamily: this.systemFontFamily,
18970 fontSize: this.systemFontSize,
18971 fontWeight: this.systemFontWeight
18972 };
18973 }, "systemFont"),
18974 external_systemFont: /* @__PURE__ */ __name(function() {
18975 return {
18976 fontFamily: this.external_systemFontFamily,
18977 fontSize: this.external_systemFontSize,
18978 fontWeight: this.external_systemFontWeight
18979 };
18980 }, "external_systemFont"),
18981 system_dbFont: /* @__PURE__ */ __name(function() {
18982 return {
18983 fontFamily: this.system_dbFontFamily,
18984 fontSize: this.system_dbFontSize,
18985 fontWeight: this.system_dbFontWeight
18986 };
18987 }, "system_dbFont"),
18988 external_system_dbFont: /* @__PURE__ */ __name(function() {
18989 return {
18990 fontFamily: this.external_system_dbFontFamily,
18991 fontSize: this.external_system_dbFontSize,
18992 fontWeight: this.external_system_dbFontWeight
18993 };
18994 }, "external_system_dbFont"),
18995 system_queueFont: /* @__PURE__ */ __name(function() {
18996 return {
18997 fontFamily: this.system_queueFontFamily,
18998 fontSize: this.system_queueFontSize,
18999 fontWeight: this.system_queueFontWeight
19000 };
19001 }, "system_queueFont"),
19002 external_system_queueFont: /* @__PURE__ */ __name(function() {
19003 return {
19004 fontFamily: this.external_system_queueFontFamily,
19005 fontSize: this.external_system_queueFontSize,
19006 fontWeight: this.external_system_queueFontWeight
19007 };
19008 }, "external_system_queueFont"),
19009 containerFont: /* @__PURE__ */ __name(function() {
19010 return {
19011 fontFamily: this.containerFontFamily,
19012 fontSize: this.containerFontSize,
19013 fontWeight: this.containerFontWeight
19014 };
19015 }, "containerFont"),
19016 external_containerFont: /* @__PURE__ */ __name(function() {
19017 return {
19018 fontFamily: this.external_containerFontFamily,
19019 fontSize: this.external_containerFontSize,
19020 fontWeight: this.external_containerFontWeight
19021 };
19022 }, "external_containerFont"),
19023 container_dbFont: /* @__PURE__ */ __name(function() {
19024 return {
19025 fontFamily: this.container_dbFontFamily,
19026 fontSize: this.container_dbFontSize,
19027 fontWeight: this.container_dbFontWeight
19028 };
19029 }, "container_dbFont"),
19030 external_container_dbFont: /* @__PURE__ */ __name(function() {
19031 return {
19032 fontFamily: this.external_container_dbFontFamily,
19033 fontSize: this.external_container_dbFontSize,
19034 fontWeight: this.external_container_dbFontWeight
19035 };
19036 }, "external_container_dbFont"),
19037 container_queueFont: /* @__PURE__ */ __name(function() {
19038 return {
19039 fontFamily: this.container_queueFontFamily,
19040 fontSize: this.container_queueFontSize,
19041 fontWeight: this.container_queueFontWeight
19042 };
19043 }, "container_queueFont"),
19044 external_container_queueFont: /* @__PURE__ */ __name(function() {
19045 return {
19046 fontFamily: this.external_container_queueFontFamily,
19047 fontSize: this.external_container_queueFontSize,
19048 fontWeight: this.external_container_queueFontWeight
19049 };
19050 }, "external_container_queueFont"),
19051 componentFont: /* @__PURE__ */ __name(function() {
19052 return {
19053 fontFamily: this.componentFontFamily,
19054 fontSize: this.componentFontSize,
19055 fontWeight: this.componentFontWeight
19056 };
19057 }, "componentFont"),
19058 external_componentFont: /* @__PURE__ */ __name(function() {
19059 return {
19060 fontFamily: this.external_componentFontFamily,
19061 fontSize: this.external_componentFontSize,
19062 fontWeight: this.external_componentFontWeight
19063 };
19064 }, "external_componentFont"),
19065 component_dbFont: /* @__PURE__ */ __name(function() {
19066 return {
19067 fontFamily: this.component_dbFontFamily,
19068 fontSize: this.component_dbFontSize,
19069 fontWeight: this.component_dbFontWeight
19070 };
19071 }, "component_dbFont"),
19072 external_component_dbFont: /* @__PURE__ */ __name(function() {
19073 return {
19074 fontFamily: this.external_component_dbFontFamily,
19075 fontSize: this.external_component_dbFontSize,
19076 fontWeight: this.external_component_dbFontWeight
19077 };
19078 }, "external_component_dbFont"),
19079 component_queueFont: /* @__PURE__ */ __name(function() {
19080 return {
19081 fontFamily: this.component_queueFontFamily,
19082 fontSize: this.component_queueFontSize,
19083 fontWeight: this.component_queueFontWeight
19084 };
19085 }, "component_queueFont"),
19086 external_component_queueFont: /* @__PURE__ */ __name(function() {
19087 return {
19088 fontFamily: this.external_component_queueFontFamily,
19089 fontSize: this.external_component_queueFontSize,
19090 fontWeight: this.external_component_queueFontWeight
19091 };
19092 }, "external_component_queueFont"),
19093 boundaryFont: /* @__PURE__ */ __name(function() {
19094 return {
19095 fontFamily: this.boundaryFontFamily,
19096 fontSize: this.boundaryFontSize,
19097 fontWeight: this.boundaryFontWeight
19098 };
19099 }, "boundaryFont"),
19100 messageFont: /* @__PURE__ */ __name(function() {
19101 return {
19102 fontFamily: this.messageFontFamily,
19103 fontSize: this.messageFontSize,
19104 fontWeight: this.messageFontWeight
19105 };
19106 }, "messageFont")
19107 },
19108 pie: {
19109 ...config_schema_default.pie,
19110 useWidth: 984
19111 },
19112 xyChart: {
19113 ...config_schema_default.xyChart,
19114 useWidth: void 0
19115 },
19116 requirement: {
19117 ...config_schema_default.requirement,
19118 useWidth: void 0
19119 },
19120 packet: {
19121 ...config_schema_default.packet
19122 },
19123 radar: {
19124 ...config_schema_default.radar
19125 }
19126 };
19127 var keyify = /* @__PURE__ */ __name((obj, prefix = "") => Object.keys(obj).reduce((res, el) => {
19128 if (Array.isArray(obj[el])) {
19129 return res;
19130 } else if (typeof obj[el] === "object" && obj[el] !== null) {
19131 return [...res, prefix + el, ...keyify(obj[el], "")];
19132 }
19133 return [...res, prefix + el];
19134 }, []), "keyify");
19135 var configKeys = new Set(keyify(config, ""));
19136 var defaultConfig_default = config;
19137
19138 // src/utils/sanitizeDirective.ts
19139 var sanitizeDirective = /* @__PURE__ */ __name((args) => {
19140 log.debug("sanitizeDirective called with", args);
19141 if (typeof args !== "object" || args == null) {
19142 return;
19143 }
19144 if (Array.isArray(args)) {
19145 args.forEach((arg) => sanitizeDirective(arg));
19146 return;
19147 }
19148 for (const key of Object.keys(args)) {
19149 log.debug("Checking key", key);
19150 if (key.startsWith("__") || key.includes("proto") || key.includes("constr") || !configKeys.has(key) || args[key] == null) {
19151 log.debug("sanitize deleting key: ", key);
19152 delete args[key];
19153 continue;
19154 }
19155 if (typeof args[key] === "object") {
19156 log.debug("sanitizing object", key);
19157 sanitizeDirective(args[key]);
19158 continue;
19159 }
19160 const cssMatchers = ["themeCSS", "fontFamily", "altFontFamily"];
19161 for (const cssKey of cssMatchers) {
19162 if (key.includes(cssKey)) {
19163 log.debug("sanitizing css option", key);
19164 args[key] = sanitizeCss(args[key]);
19165 }
19166 }
19167 }
19168 if (args.themeVariables) {
19169 for (const k of Object.keys(args.themeVariables)) {
19170 const val = args.themeVariables[k];
19171 if (val?.match && !val.match(/^[\d "#%(),.;A-Za-z]+$/)) {
19172 args.themeVariables[k] = "";
19173 }
19174 }
19175 }
19176 log.debug("After sanitization", args);
19177 }, "sanitizeDirective");
19178 var sanitizeCss = /* @__PURE__ */ __name((str) => {
19179 let startCnt = 0;
19180 let endCnt = 0;
19181 for (const element of str) {
19182 if (startCnt < endCnt) {
19183 return "{ /* ERROR: Unbalanced CSS */ }";
19184 }
19185 if (element === "{") {
19186 startCnt++;
19187 } else if (element === "}") {
19188 endCnt++;
19189 }
19190 }
19191 if (startCnt !== endCnt) {
19192 return "{ /* ERROR: Unbalanced CSS */ }";
19193 }
19194 return str;
19195 }, "sanitizeCss");
19196
19197 // src/config.ts
19198 var defaultConfig = Object.freeze(defaultConfig_default);
19199 var siteConfig = assignWithDepth_default({}, defaultConfig);
19200 var configFromInitialize;
19201 var directives = [];
19202 var currentConfig = assignWithDepth_default({}, defaultConfig);
19203 var updateCurrentConfig = /* @__PURE__ */ __name((siteCfg, _directives) => {
19204 let cfg = assignWithDepth_default({}, siteCfg);
19205 let sumOfDirectives = {};
19206 for (const d of _directives) {
19207 sanitize(d);
19208 sumOfDirectives = assignWithDepth_default(sumOfDirectives, d);
19209 }
19210 cfg = assignWithDepth_default(cfg, sumOfDirectives);
19211 if (sumOfDirectives.theme && sumOfDirectives.theme in themes_default) {
19212 const tmpConfigFromInitialize = assignWithDepth_default({}, configFromInitialize);
19213 const themeVariables = assignWithDepth_default(
19214 tmpConfigFromInitialize.themeVariables || {},
19215 sumOfDirectives.themeVariables
19216 );
19217 if (cfg.theme && cfg.theme in themes_default) {
19218 cfg.themeVariables = themes_default[cfg.theme].getThemeVariables(themeVariables);
19219 }
19220 }
19221 currentConfig = cfg;
19222 checkConfig(currentConfig);
19223 return currentConfig;
19224 }, "updateCurrentConfig");
19225 var setSiteConfig = /* @__PURE__ */ __name((conf) => {
19226 siteConfig = assignWithDepth_default({}, defaultConfig);
19227 siteConfig = assignWithDepth_default(siteConfig, conf);
19228 if (conf.theme && themes_default[conf.theme]) {
19229 siteConfig.themeVariables = themes_default[conf.theme].getThemeVariables(conf.themeVariables);
19230 }
19231 updateCurrentConfig(siteConfig, directives);
19232 return siteConfig;
19233 }, "setSiteConfig");
19234 var saveConfigFromInitialize = /* @__PURE__ */ __name((conf) => {
19235 configFromInitialize = assignWithDepth_default({}, conf);
19236 }, "saveConfigFromInitialize");
19237 var updateSiteConfig = /* @__PURE__ */ __name((conf) => {
19238 siteConfig = assignWithDepth_default(siteConfig, conf);
19239 updateCurrentConfig(siteConfig, directives);
19240 return siteConfig;
19241 }, "updateSiteConfig");
19242 var getSiteConfig = /* @__PURE__ */ __name(() => {
19243 return assignWithDepth_default({}, siteConfig);
19244 }, "getSiteConfig");
19245 var setConfig = /* @__PURE__ */ __name((conf) => {
19246 checkConfig(conf);
19247 assignWithDepth_default(currentConfig, conf);
19248 return getConfig();
19249 }, "setConfig");
19250 var getConfig = /* @__PURE__ */ __name(() => {
19251 return assignWithDepth_default({}, currentConfig);
19252 }, "getConfig");
19253 var sanitize = /* @__PURE__ */ __name((options) => {
19254 if (!options) {
19255 return;
19256 }
19257 ["secure", ...siteConfig.secure ?? []].forEach((key) => {
19258 if (Object.hasOwn(options, key)) {
19259 log.debug(`Denied attempt to modify a secure key ${key}`, options[key]);
19260 delete options[key];
19261 }
19262 });
19263 Object.keys(options).forEach((key) => {
19264 if (key.startsWith("__")) {
19265 delete options[key];
19266 }
19267 });
19268 Object.keys(options).forEach((key) => {
19269 if (typeof options[key] === "string" && (options[key].includes("<") || options[key].includes(">") || options[key].includes("url(data:"))) {
19270 delete options[key];
19271 }
19272 if (typeof options[key] === "object") {
19273 sanitize(options[key]);
19274 }
19275 });
19276 }, "sanitize");
19277 var addDirective = /* @__PURE__ */ __name((directive) => {
19278 sanitizeDirective(directive);
19279 if (directive.fontFamily && !directive.themeVariables?.fontFamily) {
19280 directive.themeVariables = {
19281 ...directive.themeVariables,
19282 fontFamily: directive.fontFamily
19283 };
19284 }
19285 directives.push(directive);
19286 updateCurrentConfig(siteConfig, directives);
19287 }, "addDirective");
19288 var chunk_YTJNT7DU_reset = /* @__PURE__ */ __name((config2 = siteConfig) => {
19289 directives = [];
19290 updateCurrentConfig(config2, directives);
19291 }, "reset");
19292 var ConfigWarning = {
19293 LAZY_LOAD_DEPRECATED: "The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead."
19294 };
19295 var issuedWarnings = {};
19296 var issueWarning = /* @__PURE__ */ __name((warning) => {
19297 if (issuedWarnings[warning]) {
19298 return;
19299 }
19300 log.warn(ConfigWarning[warning]);
19301 issuedWarnings[warning] = true;
19302 }, "issueWarning");
19303 var checkConfig = /* @__PURE__ */ __name((config2) => {
19304 if (!config2) {
19305 return;
19306 }
19307 if (config2.lazyLoadedDiagrams || config2.loadExternalDiagramsAtStartup) {
19308 issueWarning("LAZY_LOAD_DEPRECATED");
19309 }
19310 }, "checkConfig");
19311
19312 // src/diagrams/common/common.ts
19313
19314 var lineBreakRegex = /<br\s*\/?>/gi;
19315 var getRows = /* @__PURE__ */ __name((s) => {
19316 if (!s) {
19317 return [""];
19318 }
19319 const str = breakToPlaceholder(s).replace(/\\n/g, "#br#");
19320 return str.split("#br#");
19321 }, "getRows");
19322 var setupDompurifyHooksIfNotSetup = /* @__PURE__ */ (() => {
19323 let setup = false;
19324 return () => {
19325 if (!setup) {
19326 setupDompurifyHooks();
19327 setup = true;
19328 }
19329 };
19330 })();
19331 function setupDompurifyHooks() {
19332 const TEMPORARY_ATTRIBUTE = "data-temp-href-target";
19333 purify_es/* default */.Z.addHook("beforeSanitizeAttributes", (node) => {
19334 if (node instanceof Element && node.tagName === "A" && node.hasAttribute("target")) {
19335 node.setAttribute(TEMPORARY_ATTRIBUTE, node.getAttribute("target") ?? "");
19336 }
19337 });
19338 purify_es/* default */.Z.addHook("afterSanitizeAttributes", (node) => {
19339 if (node instanceof Element && node.tagName === "A" && node.hasAttribute(TEMPORARY_ATTRIBUTE)) {
19340 node.setAttribute("target", node.getAttribute(TEMPORARY_ATTRIBUTE) ?? "");
19341 node.removeAttribute(TEMPORARY_ATTRIBUTE);
19342 if (node.getAttribute("target") === "_blank") {
19343 node.setAttribute("rel", "noopener");
19344 }
19345 }
19346 });
19347 }
19348 __name(setupDompurifyHooks, "setupDompurifyHooks");
19349 var removeScript = /* @__PURE__ */ __name((txt) => {
19350 setupDompurifyHooksIfNotSetup();
19351 const sanitizedText = purify_es/* default */.Z.sanitize(txt);
19352 return sanitizedText;
19353 }, "removeScript");
19354 var sanitizeMore = /* @__PURE__ */ __name((text, config2) => {
19355 if (config2.flowchart?.htmlLabels !== false) {
19356 const level = config2.securityLevel;
19357 if (level === "antiscript" || level === "strict") {
19358 text = removeScript(text);
19359 } else if (level !== "loose") {
19360 text = breakToPlaceholder(text);
19361 text = text.replace(/</g, "<").replace(/>/g, ">");
19362 text = text.replace(/=/g, "=");
19363 text = placeholderToBreak(text);
19364 }
19365 }
19366 return text;
19367 }, "sanitizeMore");
19368 var sanitizeText = /* @__PURE__ */ __name((text, config2) => {
19369 if (!text) {
19370 return text;
19371 }
19372 if (config2.dompurifyConfig) {
19373 text = purify_es/* default */.Z.sanitize(sanitizeMore(text, config2), config2.dompurifyConfig).toString();
19374 } else {
19375 text = purify_es/* default */.Z.sanitize(sanitizeMore(text, config2), {
19376 FORBID_TAGS: ["style"]
19377 }).toString();
19378 }
19379 return text;
19380 }, "sanitizeText");
19381 var sanitizeTextOrArray = /* @__PURE__ */ __name((a, config2) => {
19382 if (typeof a === "string") {
19383 return sanitizeText(a, config2);
19384 }
19385 return a.flat().map((x) => sanitizeText(x, config2));
19386 }, "sanitizeTextOrArray");
19387 var hasBreaks = /* @__PURE__ */ __name((text) => {
19388 return lineBreakRegex.test(text);
19389 }, "hasBreaks");
19390 var splitBreaks = /* @__PURE__ */ __name((text) => {
19391 return text.split(lineBreakRegex);
19392 }, "splitBreaks");
19393 var placeholderToBreak = /* @__PURE__ */ __name((s) => {
19394 return s.replace(/#br#/g, "<br/>");
19395 }, "placeholderToBreak");
19396 var breakToPlaceholder = /* @__PURE__ */ __name((s) => {
19397 return s.replace(lineBreakRegex, "#br#");
19398 }, "breakToPlaceholder");
19399 var getUrl = /* @__PURE__ */ __name((useAbsolute) => {
19400 let url = "";
19401 if (useAbsolute) {
19402 url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search;
19403 url = url.replaceAll(/\(/g, "\\(");
19404 url = url.replaceAll(/\)/g, "\\)");
19405 }
19406 return url;
19407 }, "getUrl");
19408 var evaluate = /* @__PURE__ */ __name((val) => val === false || ["false", "null", "0"].includes(String(val).trim().toLowerCase()) ? false : true, "evaluate");
19409 var getMax = /* @__PURE__ */ __name(function(...values) {
19410 const newValues = values.filter((value) => {
19411 return !isNaN(value);
19412 });
19413 return Math.max(...newValues);
19414 }, "getMax");
19415 var getMin = /* @__PURE__ */ __name(function(...values) {
19416 const newValues = values.filter((value) => {
19417 return !isNaN(value);
19418 });
19419 return Math.min(...newValues);
19420 }, "getMin");
19421 var parseGenericTypes = /* @__PURE__ */ __name(function(input) {
19422 const inputSets = input.split(/(,)/);
19423 const output = [];
19424 for (let i = 0; i < inputSets.length; i++) {
19425 let thisSet = inputSets[i];
19426 if (thisSet === "," && i > 0 && i + 1 < inputSets.length) {
19427 const previousSet = inputSets[i - 1];
19428 const nextSet = inputSets[i + 1];
19429 if (shouldCombineSets(previousSet, nextSet)) {
19430 thisSet = previousSet + "," + nextSet;
19431 i++;
19432 output.pop();
19433 }
19434 }
19435 output.push(processSet(thisSet));
19436 }
19437 return output.join("");
19438 }, "parseGenericTypes");
19439 var countOccurrence = /* @__PURE__ */ __name((string, substring) => {
19440 return Math.max(0, string.split(substring).length - 1);
19441 }, "countOccurrence");
19442 var shouldCombineSets = /* @__PURE__ */ __name((previousSet, nextSet) => {
19443 const prevCount = countOccurrence(previousSet, "~");
19444 const nextCount = countOccurrence(nextSet, "~");
19445 return prevCount === 1 && nextCount === 1;
19446 }, "shouldCombineSets");
19447 var processSet = /* @__PURE__ */ __name((input) => {
19448 const tildeCount = countOccurrence(input, "~");
19449 let hasStartingTilde = false;
19450 if (tildeCount <= 1) {
19451 return input;
19452 }
19453 if (tildeCount % 2 !== 0 && input.startsWith("~")) {
19454 input = input.substring(1);
19455 hasStartingTilde = true;
19456 }
19457 const chars = [...input];
19458 let first = chars.indexOf("~");
19459 let last = chars.lastIndexOf("~");
19460 while (first !== -1 && last !== -1 && first !== last) {
19461 chars[first] = "<";
19462 chars[last] = ">";
19463 first = chars.indexOf("~");
19464 last = chars.lastIndexOf("~");
19465 }
19466 if (hasStartingTilde) {
19467 chars.unshift("~");
19468 }
19469 return chars.join("");
19470 }, "processSet");
19471 var isMathMLSupported = /* @__PURE__ */ __name(() => window.MathMLElement !== void 0, "isMathMLSupported");
19472 var katexRegex = /\$\$(.*)\$\$/g;
19473 var hasKatex = /* @__PURE__ */ __name((text) => (text.match(katexRegex)?.length ?? 0) > 0, "hasKatex");
19474 var calculateMathMLDimensions = /* @__PURE__ */ __name(async (text, config2) => {
19475 text = await renderKatex(text, config2);
19476 const divElem = document.createElement("div");
19477 divElem.innerHTML = text;
19478 divElem.id = "katex-temp";
19479 divElem.style.visibility = "hidden";
19480 divElem.style.position = "absolute";
19481 divElem.style.top = "0";
19482 const body = document.querySelector("body");
19483 body?.insertAdjacentElement("beforeend", divElem);
19484 const dim = { width: divElem.clientWidth, height: divElem.clientHeight };
19485 divElem.remove();
19486 return dim;
19487 }, "calculateMathMLDimensions");
19488 var renderKatex = /* @__PURE__ */ __name(async (text, config2) => {
19489 if (!hasKatex(text)) {
19490 return text;
19491 }
19492 if (!(isMathMLSupported() || config2.legacyMathML || config2.forceLegacyMathML)) {
19493 return text.replace(katexRegex, "MathML is unsupported in this environment.");
19494 }
19495 const { default: katex } = await __webpack_require__.e(/* import() */ 100).then(__webpack_require__.bind(__webpack_require__, 60100));
19496 const outputMode = config2.forceLegacyMathML || !isMathMLSupported() && config2.legacyMathML ? "htmlAndMathml" : "mathml";
19497 return text.split(lineBreakRegex).map(
19498 (line) => hasKatex(line) ? `<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${line}</div>` : `<div>${line}</div>`
19499 ).join("").replace(
19500 katexRegex,
19501 (_, c) => katex.renderToString(c, {
19502 throwOnError: true,
19503 displayMode: true,
19504 output: outputMode
19505 }).replace(/\n/g, " ").replace(/<annotation.*<\/annotation>/g, "")
19506 );
19507 }, "renderKatex");
19508 var common_default = {
19509 getRows,
19510 sanitizeText,
19511 sanitizeTextOrArray,
19512 hasBreaks,
19513 splitBreaks,
19514 lineBreakRegex,
19515 removeScript,
19516 getUrl,
19517 evaluate,
19518 getMax,
19519 getMin
19520 };
19521
19522 // src/setupGraphViewbox.js
19523 var d3Attrs = /* @__PURE__ */ __name(function(d3Elem, attrs) {
19524 for (let attr of attrs) {
19525 d3Elem.attr(attr[0], attr[1]);
19526 }
19527 }, "d3Attrs");
19528 var calculateSvgSizeAttrs = /* @__PURE__ */ __name(function(height, width, useMaxWidth) {
19529 let attrs = /* @__PURE__ */ new Map();
19530 if (useMaxWidth) {
19531 attrs.set("width", "100%");
19532 attrs.set("style", `max-width: ${width}px;`);
19533 } else {
19534 attrs.set("height", height);
19535 attrs.set("width", width);
19536 }
19537 return attrs;
19538 }, "calculateSvgSizeAttrs");
19539 var configureSvgSize = /* @__PURE__ */ __name(function(svgElem, height, width, useMaxWidth) {
19540 const attrs = calculateSvgSizeAttrs(height, width, useMaxWidth);
19541 d3Attrs(svgElem, attrs);
19542 }, "configureSvgSize");
19543 var setupGraphViewbox = /* @__PURE__ */ __name(function(graph, svgElem, padding, useMaxWidth) {
19544 const svgBounds = svgElem.node().getBBox();
19545 const sWidth = svgBounds.width;
19546 const sHeight = svgBounds.height;
19547 log.info(`SVG bounds: ${sWidth}x${sHeight}`, svgBounds);
19548 let width = 0;
19549 let height = 0;
19550 log.info(`Graph bounds: ${width}x${height}`, graph);
19551 width = sWidth + padding * 2;
19552 height = sHeight + padding * 2;
19553 log.info(`Calculated bounds: ${width}x${height}`);
19554 configureSvgSize(svgElem, height, width, useMaxWidth);
19555 const vBox = `${svgBounds.x - padding} ${svgBounds.y - padding} ${svgBounds.width + 2 * padding} ${svgBounds.height + 2 * padding}`;
19556 svgElem.attr("viewBox", vBox);
19557 }, "setupGraphViewbox");
19558
19559 // src/styles.ts
19560 var themes = {};
19561 var getStyles = /* @__PURE__ */ __name((type, userStyles, options) => {
19562 let diagramStyles = "";
19563 if (type in themes && themes[type]) {
19564 diagramStyles = themes[type](options);
19565 } else {
19566 log.warn(`No theme found for ${type}`);
19567 }
19568 return ` & {
19569 font-family: ${options.fontFamily};
19570 font-size: ${options.fontSize};
19571 fill: ${options.textColor}
19572 }
19573 @keyframes edge-animation-frame {
19574 from {
19575 stroke-dashoffset: 0;
19576 }
19577 }
19578 @keyframes dash {
19579 to {
19580 stroke-dashoffset: 0;
19581 }
19582 }
19583 & .edge-animation-slow {
19584 stroke-dasharray: 9,5 !important;
19585 stroke-dashoffset: 900;
19586 animation: dash 50s linear infinite;
19587 stroke-linecap: round;
19588 }
19589 & .edge-animation-fast {
19590 stroke-dasharray: 9,5 !important;
19591 stroke-dashoffset: 900;
19592 animation: dash 20s linear infinite;
19593 stroke-linecap: round;
19594 }
19595 /* Classes common for multiple diagrams */
19596
19597 & .error-icon {
19598 fill: ${options.errorBkgColor};
19599 }
19600 & .error-text {
19601 fill: ${options.errorTextColor};
19602 stroke: ${options.errorTextColor};
19603 }
19604
19605 & .edge-thickness-normal {
19606 stroke-width: 1px;
19607 }
19608 & .edge-thickness-thick {
19609 stroke-width: 3.5px
19610 }
19611 & .edge-pattern-solid {
19612 stroke-dasharray: 0;
19613 }
19614 & .edge-thickness-invisible {
19615 stroke-width: 0;
19616 fill: none;
19617 }
19618 & .edge-pattern-dashed{
19619 stroke-dasharray: 3;
19620 }
19621 .edge-pattern-dotted {
19622 stroke-dasharray: 2;
19623 }
19624
19625 & .marker {
19626 fill: ${options.lineColor};
19627 stroke: ${options.lineColor};
19628 }
19629 & .marker.cross {
19630 stroke: ${options.lineColor};
19631 }
19632
19633 & svg {
19634 font-family: ${options.fontFamily};
19635 font-size: ${options.fontSize};
19636 }
19637 & p {
19638 margin: 0
19639 }
19640
19641 ${diagramStyles}
19642
19643 ${userStyles}
19644 `;
19645 }, "getStyles");
19646 var addStylesForDiagram = /* @__PURE__ */ __name((type, diagramTheme) => {
19647 if (diagramTheme !== void 0) {
19648 themes[type] = diagramTheme;
19649 }
19650 }, "addStylesForDiagram");
19651 var styles_default = getStyles;
19652
19653 // src/diagrams/common/commonDb.ts
19654 var commonDb_exports = {};
19655 __export(commonDb_exports, {
19656 clear: () => clear,
19657 getAccDescription: () => getAccDescription,
19658 getAccTitle: () => getAccTitle,
19659 getDiagramTitle: () => getDiagramTitle,
19660 setAccDescription: () => setAccDescription,
19661 setAccTitle: () => setAccTitle,
19662 setDiagramTitle: () => setDiagramTitle
19663 });
19664 var accTitle = "";
19665 var diagramTitle = "";
19666 var accDescription = "";
19667 var sanitizeText2 = /* @__PURE__ */ __name((txt) => sanitizeText(txt, getConfig()), "sanitizeText");
19668 var clear = /* @__PURE__ */ __name(() => {
19669 accTitle = "";
19670 accDescription = "";
19671 diagramTitle = "";
19672 }, "clear");
19673 var setAccTitle = /* @__PURE__ */ __name((txt) => {
19674 accTitle = sanitizeText2(txt).replace(/^\s+/g, "");
19675 }, "setAccTitle");
19676 var getAccTitle = /* @__PURE__ */ __name(() => accTitle, "getAccTitle");
19677 var setAccDescription = /* @__PURE__ */ __name((txt) => {
19678 accDescription = sanitizeText2(txt).replace(/\n\s+/g, "\n");
19679 }, "setAccDescription");
19680 var getAccDescription = /* @__PURE__ */ __name(() => accDescription, "getAccDescription");
19681 var setDiagramTitle = /* @__PURE__ */ __name((txt) => {
19682 diagramTitle = sanitizeText2(txt);
19683 }, "setDiagramTitle");
19684 var getDiagramTitle = /* @__PURE__ */ __name(() => diagramTitle, "getDiagramTitle");
19685
19686 // src/diagram-api/diagramAPI.ts
19687 var log2 = log;
19688 var setLogLevel2 = setLogLevel;
19689 var getConfig2 = getConfig;
19690 var setConfig2 = setConfig;
19691 var defaultConfig2 = defaultConfig;
19692 var sanitizeText3 = /* @__PURE__ */ __name((text) => sanitizeText(text, getConfig2()), "sanitizeText");
19693 var setupGraphViewbox2 = setupGraphViewbox;
19694 var getCommonDb = /* @__PURE__ */ __name(() => {
19695 return commonDb_exports;
19696 }, "getCommonDb");
19697 var diagrams = {};
19698 var registerDiagram = /* @__PURE__ */ __name((id, diagram, detector) => {
19699 if (diagrams[id]) {
19700 log2.warn(`Diagram with id ${id} already registered. Overwriting.`);
19701 }
19702 diagrams[id] = diagram;
19703 if (detector) {
19704 addDetector(id, detector);
19705 }
19706 addStylesForDiagram(id, diagram.styles);
19707 diagram.injectUtils?.(
19708 log2,
19709 setLogLevel2,
19710 getConfig2,
19711 sanitizeText3,
19712 setupGraphViewbox2,
19713 getCommonDb(),
19714 () => {
19715 }
19716 );
19717 }, "registerDiagram");
19718 var getDiagram = /* @__PURE__ */ __name((name) => {
19719 if (name in diagrams) {
19720 return diagrams[name];
19721 }
19722 throw new DiagramNotFoundError(name);
19723 }, "getDiagram");
19724 var DiagramNotFoundError = class extends Error {
19725 static {
19726 __name(this, "DiagramNotFoundError");
19727 }
19728 constructor(name) {
19729 super(`Diagram ${name} not found.`);
19730 }
19731 };
19732
19733
19734
19735
19736 /***/ }),
19737
19738 /***/ 94406:
19739 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
19740
19741 "use strict";
19742 // ESM COMPAT FLAG
19743 __webpack_require__.r(__webpack_exports__);
19744
19745 // EXPORTS
19746 __webpack_require__.d(__webpack_exports__, {
19747 "default": () => (/* binding */ mermaid_default)
19748 });
19749
19750 // EXTERNAL MODULE: ../node_modules/mermaid/dist/chunks/mermaid.core/chunk-6JRP7KZX.mjs
19751 var chunk_6JRP7KZX = __webpack_require__(98719);
19752 // EXTERNAL MODULE: ../node_modules/mermaid/dist/chunks/mermaid.core/chunk-TYCBKAJE.mjs
19753 var chunk_TYCBKAJE = __webpack_require__(83696);
19754 // EXTERNAL MODULE: ../node_modules/mermaid/dist/chunks/mermaid.core/chunk-IIMUDSI4.mjs
19755 var chunk_IIMUDSI4 = __webpack_require__(52017);
19756 // EXTERNAL MODULE: ../node_modules/mermaid/dist/chunks/mermaid.core/chunk-VV3M67IP.mjs
19757 var chunk_VV3M67IP = __webpack_require__(83133);
19758 // EXTERNAL MODULE: ../node_modules/mermaid/dist/chunks/mermaid.core/chunk-HRU6DDCH.mjs
19759 var chunk_HRU6DDCH = __webpack_require__(41921);
19760 // EXTERNAL MODULE: ../node_modules/mermaid/dist/chunks/mermaid.core/chunk-K557N5IZ.mjs
19761 var chunk_K557N5IZ = __webpack_require__(81861);
19762 // EXTERNAL MODULE: ../node_modules/mermaid/dist/chunks/mermaid.core/chunk-H2D2JQ3I.mjs + 12 modules
19763 var chunk_H2D2JQ3I = __webpack_require__(62072);
19764 // EXTERNAL MODULE: ../node_modules/mermaid/dist/chunks/mermaid.core/chunk-C3MQ5ANM.mjs
19765 var chunk_C3MQ5ANM = __webpack_require__(39769);
19766 // EXTERNAL MODULE: ../node_modules/mermaid/dist/chunks/mermaid.core/chunk-O4NI6UNU.mjs
19767 var chunk_O4NI6UNU = __webpack_require__(42626);
19768 // EXTERNAL MODULE: ../node_modules/mermaid/dist/chunks/mermaid.core/chunk-5NNNAHNI.mjs
19769 var chunk_5NNNAHNI = __webpack_require__(57385);
19770 // EXTERNAL MODULE: ../node_modules/mermaid/dist/chunks/mermaid.core/chunk-7B677QYD.mjs
19771 var chunk_7B677QYD = __webpack_require__(30103);
19772 // EXTERNAL MODULE: ../node_modules/mermaid/dist/chunks/mermaid.core/chunk-YTJNT7DU.mjs + 3 modules
19773 var chunk_YTJNT7DU = __webpack_require__(86906);
19774 // EXTERNAL MODULE: ../node_modules/ts-dedent/esm/index.js
19775 var esm = __webpack_require__(11464);
19776 // EXTERNAL MODULE: ../node_modules/d3/src/index.js + 97 modules
19777 var src = __webpack_require__(83619);
19778 ;// CONCATENATED MODULE: ../node_modules/stylis/src/Enum.js
19779 var MS = '-ms-'
19780 var MOZ = '-moz-'
19781 var WEBKIT = '-webkit-'
19782
19783 var COMMENT = 'comm'
19784 var RULESET = 'rule'
19785 var DECLARATION = 'decl'
19786
19787 var PAGE = '@page'
19788 var MEDIA = '@media'
19789 var IMPORT = '@import'
19790 var CHARSET = '@charset'
19791 var VIEWPORT = '@viewport'
19792 var SUPPORTS = '@supports'
19793 var DOCUMENT = '@document'
19794 var NAMESPACE = '@namespace'
19795 var KEYFRAMES = '@keyframes'
19796 var FONT_FACE = '@font-face'
19797 var COUNTER_STYLE = '@counter-style'
19798 var FONT_FEATURE_VALUES = '@font-feature-values'
19799 var LAYER = '@layer'
19800 var SCOPE = '@scope'
19801
19802 ;// CONCATENATED MODULE: ../node_modules/stylis/src/Utility.js
19803 /**
19804 * @param {number}
19805 * @return {number}
19806 */
19807 var abs = Math.abs
19808
19809 /**
19810 * @param {number}
19811 * @return {string}
19812 */
19813 var Utility_from = String.fromCharCode
19814
19815 /**
19816 * @param {object}
19817 * @return {object}
19818 */
19819 var Utility_assign = Object.assign
19820
19821 /**
19822 * @param {string} value
19823 * @param {number} length
19824 * @return {number}
19825 */
19826 function hash (value, length) {
19827 return charat(value, 0) ^ 45 ? (((((((length << 2) ^ charat(value, 0)) << 2) ^ charat(value, 1)) << 2) ^ charat(value, 2)) << 2) ^ charat(value, 3) : 0
19828 }
19829
19830 /**
19831 * @param {string} value
19832 * @return {string}
19833 */
19834 function trim (value) {
19835 return value.trim()
19836 }
19837
19838 /**
19839 * @param {string} value
19840 * @param {RegExp} pattern
19841 * @return {string?}
19842 */
19843 function match (value, pattern) {
19844 return (value = pattern.exec(value)) ? value[0] : value
19845 }
19846
19847 /**
19848 * @param {string} value
19849 * @param {(string|RegExp)} pattern
19850 * @param {string} replacement
19851 * @return {string}
19852 */
19853 function replace (value, pattern, replacement) {
19854 return value.replace(pattern, replacement)
19855 }
19856
19857 /**
19858 * @param {string} value
19859 * @param {string} search
19860 * @param {number} position
19861 * @return {number}
19862 */
19863 function indexof (value, search, position) {
19864 return value.indexOf(search, position)
19865 }
19866
19867 /**
19868 * @param {string} value
19869 * @param {number} index
19870 * @return {number}
19871 */
19872 function charat (value, index) {
19873 return value.charCodeAt(index) | 0
19874 }
19875
19876 /**
19877 * @param {string} value
19878 * @param {number} begin
19879 * @param {number} end
19880 * @return {string}
19881 */
19882 function substr (value, begin, end) {
19883 return value.slice(begin, end)
19884 }
19885
19886 /**
19887 * @param {string} value
19888 * @return {number}
19889 */
19890 function strlen (value) {
19891 return value.length
19892 }
19893
19894 /**
19895 * @param {any[]} value
19896 * @return {number}
19897 */
19898 function sizeof (value) {
19899 return value.length
19900 }
19901
19902 /**
19903 * @param {any} value
19904 * @param {any[]} array
19905 * @return {any}
19906 */
19907 function Utility_append (value, array) {
19908 return array.push(value), value
19909 }
19910
19911 /**
19912 * @param {string[]} array
19913 * @param {function} callback
19914 * @return {string}
19915 */
19916 function combine (array, callback) {
19917 return array.map(callback).join('')
19918 }
19919
19920 /**
19921 * @param {string[]} array
19922 * @param {RegExp} pattern
19923 * @return {string[]}
19924 */
19925 function filter (array, pattern) {
19926 return array.filter(function (value) { return !match(value, pattern) })
19927 }
19928
19929 ;// CONCATENATED MODULE: ../node_modules/stylis/src/Serializer.js
19930
19931
19932
19933 /**
19934 * @param {object[]} children
19935 * @param {function} callback
19936 * @return {string}
19937 */
19938 function serialize (children, callback) {
19939 var output = ''
19940
19941 for (var i = 0; i < children.length; i++)
19942 output += callback(children[i], i, children, callback) || ''
19943
19944 return output
19945 }
19946
19947 /**
19948 * @param {object} element
19949 * @param {number} index
19950 * @param {object[]} children
19951 * @param {function} callback
19952 * @return {string}
19953 */
19954 function stringify (element, index, children, callback) {
19955 switch (element.type) {
19956 case LAYER: if (element.children.length) break
19957 case IMPORT: case NAMESPACE: case DECLARATION: return element.return = element.return || element.value
19958 case COMMENT: return ''
19959 case KEYFRAMES: return element.return = element.value + '{' + serialize(element.children, callback) + '}'
19960 case RULESET: if (!strlen(element.value = element.props.join(','))) return ''
19961 }
19962
19963 return strlen(children = serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''
19964 }
19965
19966 ;// CONCATENATED MODULE: ../node_modules/stylis/src/Tokenizer.js
19967
19968
19969 var line = 1
19970 var column = 1
19971 var Tokenizer_length = 0
19972 var position = 0
19973 var character = 0
19974 var characters = ''
19975
19976 /**
19977 * @param {string} value
19978 * @param {object | null} root
19979 * @param {object | null} parent
19980 * @param {string} type
19981 * @param {string[] | string} props
19982 * @param {object[] | string} children
19983 * @param {object[]} siblings
19984 * @param {number} length
19985 */
19986 function node (value, root, parent, type, props, children, length, siblings) {
19987 return {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: '', siblings: siblings}
19988 }
19989
19990 /**
19991 * @param {object} root
19992 * @param {object} props
19993 * @return {object}
19994 */
19995 function copy (root, props) {
19996 return assign(node('', null, null, '', null, null, 0, root.siblings), root, {length: -root.length}, props)
19997 }
19998
19999 /**
20000 * @param {object} root
20001 */
20002 function lift (root) {
20003 while (root.root)
20004 root = copy(root.root, {children: [root]})
20005
20006 append(root, root.siblings)
20007 }
20008
20009 /**
20010 * @return {number}
20011 */
20012 function Tokenizer_char () {
20013 return character
20014 }
20015
20016 /**
20017 * @return {number}
20018 */
20019 function prev () {
20020 character = position > 0 ? charat(characters, --position) : 0
20021
20022 if (column--, character === 10)
20023 column = 1, line--
20024
20025 return character
20026 }
20027
20028 /**
20029 * @return {number}
20030 */
20031 function next () {
20032 character = position < Tokenizer_length ? charat(characters, position++) : 0
20033
20034 if (column++, character === 10)
20035 column = 1, line++
20036
20037 return character
20038 }
20039
20040 /**
20041 * @return {number}
20042 */
20043 function peek () {
20044 return charat(characters, position)
20045 }
20046
20047 /**
20048 * @return {number}
20049 */
20050 function caret () {
20051 return position
20052 }
20053
20054 /**
20055 * @param {number} begin
20056 * @param {number} end
20057 * @return {string}
20058 */
20059 function slice (begin, end) {
20060 return substr(characters, begin, end)
20061 }
20062
20063 /**
20064 * @param {number} type
20065 * @return {number}
20066 */
20067 function token (type) {
20068 switch (type) {
20069 // \0 \t \n \r \s whitespace token
20070 case 0: case 9: case 10: case 13: case 32:
20071 return 5
20072 // ! + , / > @ ~ isolate token
20073 case 33: case 43: case 44: case 47: case 62: case 64: case 126:
20074 // ; { } breakpoint token
20075 case 59: case 123: case 125:
20076 return 4
20077 // : accompanied token
20078 case 58:
20079 return 3
20080 // " ' ( [ opening delimit token
20081 case 34: case 39: case 40: case 91:
20082 return 2
20083 // ) ] closing delimit token
20084 case 41: case 93:
20085 return 1
20086 }
20087
20088 return 0
20089 }
20090
20091 /**
20092 * @param {string} value
20093 * @return {any[]}
20094 */
20095 function alloc (value) {
20096 return line = column = 1, Tokenizer_length = strlen(characters = value), position = 0, []
20097 }
20098
20099 /**
20100 * @param {any} value
20101 * @return {any}
20102 */
20103 function dealloc (value) {
20104 return characters = '', value
20105 }
20106
20107 /**
20108 * @param {number} type
20109 * @return {string}
20110 */
20111 function delimit (type) {
20112 return trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))
20113 }
20114
20115 /**
20116 * @param {string} value
20117 * @return {string[]}
20118 */
20119 function tokenize (value) {
20120 return dealloc(tokenizer(alloc(value)))
20121 }
20122
20123 /**
20124 * @param {number} type
20125 * @return {string}
20126 */
20127 function whitespace (type) {
20128 while (character = peek())
20129 if (character < 33)
20130 next()
20131 else
20132 break
20133
20134 return token(type) > 2 || token(character) > 3 ? '' : ' '
20135 }
20136
20137 /**
20138 * @param {string[]} children
20139 * @return {string[]}
20140 */
20141 function tokenizer (children) {
20142 while (next())
20143 switch (token(character)) {
20144 case 0: append(identifier(position - 1), children)
20145 break
20146 case 2: append(delimit(character), children)
20147 break
20148 default: append(from(character), children)
20149 }
20150
20151 return children
20152 }
20153
20154 /**
20155 * @param {number} index
20156 * @param {number} count
20157 * @return {string}
20158 */
20159 function escaping (index, count) {
20160 while (--count && next())
20161 // not 0-9 A-F a-f
20162 if (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97))
20163 break
20164
20165 return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32))
20166 }
20167
20168 /**
20169 * @param {number} type
20170 * @return {number}
20171 */
20172 function delimiter (type) {
20173 while (next())
20174 switch (character) {
20175 // ] ) " '
20176 case type:
20177 return position
20178 // " '
20179 case 34: case 39:
20180 if (type !== 34 && type !== 39)
20181 delimiter(character)
20182 break
20183 // (
20184 case 40:
20185 if (type === 41)
20186 delimiter(type)
20187 break
20188 // \
20189 case 92:
20190 next()
20191 break
20192 }
20193
20194 return position
20195 }
20196
20197 /**
20198 * @param {number} type
20199 * @param {number} index
20200 * @return {number}
20201 */
20202 function commenter (type, index) {
20203 while (next())
20204 // //
20205 if (type + character === 47 + 10)
20206 break
20207 // /*
20208 else if (type + character === 42 + 42 && peek() === 47)
20209 break
20210
20211 return '/*' + slice(index, position - 1) + '*' + Utility_from(type === 47 ? type : next())
20212 }
20213
20214 /**
20215 * @param {number} index
20216 * @return {string}
20217 */
20218 function identifier (index) {
20219 while (!token(peek()))
20220 next()
20221
20222 return slice(index, position)
20223 }
20224
20225 ;// CONCATENATED MODULE: ../node_modules/stylis/src/Parser.js
20226
20227
20228
20229
20230 /**
20231 * @param {string} value
20232 * @return {object[]}
20233 */
20234 function compile (value) {
20235 return dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value))
20236 }
20237
20238 /**
20239 * @param {string} value
20240 * @param {object} root
20241 * @param {object?} parent
20242 * @param {string[]} rule
20243 * @param {string[]} rules
20244 * @param {string[]} rulesets
20245 * @param {number[]} pseudo
20246 * @param {number[]} points
20247 * @param {string[]} declarations
20248 * @return {object}
20249 */
20250 function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {
20251 var index = 0
20252 var offset = 0
20253 var length = pseudo
20254 var atrule = 0
20255 var property = 0
20256 var previous = 0
20257 var variable = 1
20258 var scanning = 1
20259 var ampersand = 1
20260 var character = 0
20261 var type = ''
20262 var props = rules
20263 var children = rulesets
20264 var reference = rule
20265 var characters = type
20266
20267 while (scanning)
20268 switch (previous = character, character = next()) {
20269 // (
20270 case 40:
20271 if (previous != 108 && charat(characters, length - 1) == 58) {
20272 if (indexof(characters += replace(delimit(character), '&', '&\f'), '&\f', abs(index ? points[index - 1] : 0)) != -1)
20273 ampersand = -1
20274 break
20275 }
20276 // " ' [
20277 case 34: case 39: case 91:
20278 characters += delimit(character)
20279 break
20280 // \t \n \r \s
20281 case 9: case 10: case 13: case 32:
20282 characters += whitespace(previous)
20283 break
20284 // \
20285 case 92:
20286 characters += escaping(caret() - 1, 7)
20287 continue
20288 // /
20289 case 47:
20290 switch (peek()) {
20291 case 42: case 47:
20292 Utility_append(comment(commenter(next(), caret()), root, parent, declarations), declarations)
20293 if ((token(previous || 1) == 5 || token(peek() || 1) == 5) && strlen(characters) && substr(characters, -1, void 0) !== ' ') characters += ' '
20294 break
20295 default:
20296 characters += '/'
20297 }
20298 break
20299 // {
20300 case 123 * variable:
20301 points[index++] = strlen(characters) * ampersand
20302 // } ; \0
20303 case 125 * variable: case 59: case 0:
20304 switch (character) {
20305 // \0 }
20306 case 0: case 125: scanning = 0
20307 // ;
20308 case 59 + offset: if (ampersand == -1) characters = replace(characters, /\f/g, '')
20309 if (property > 0 && (strlen(characters) - length || (variable === 0 && previous === 47)))
20310 Utility_append(property > 32 ? declaration(characters + ';', rule, parent, length - 1, declarations) : declaration(replace(characters, ' ', '') + ';', rule, parent, length - 2, declarations), declarations)
20311 break
20312 // @ ;
20313 case 59: characters += ';'
20314 // { rule/at-rule
20315 default:
20316 Utility_append(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length, rulesets), rulesets)
20317
20318 if (character === 123)
20319 if (offset === 0)
20320 parse(characters, root, reference, reference, props, rulesets, length, points, children)
20321 else {
20322 switch (atrule) {
20323 // c(ontainer)
20324 case 99:
20325 if (charat(characters, 3) === 110) break
20326 // l(ayer)
20327 case 108:
20328 if (charat(characters, 2) === 97) break
20329 default:
20330 offset = 0
20331 // d(ocument) m(edia) s(upports)
20332 case 100: case 109: case 115:
20333 }
20334 if (offset) parse(value, reference, reference, rule && Utility_append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length, children), children), rules, children, length, points, rule ? props : children)
20335 else parse(characters, reference, reference, reference, [''], children, 0, points, children)
20336 }
20337 }
20338
20339 index = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo
20340 break
20341 // :
20342 case 58:
20343 length = 1 + strlen(characters), property = previous
20344 default:
20345 if (variable < 1)
20346 if (character == 123)
20347 --variable
20348 else if (character == 125 && variable++ == 0 && prev() == 125)
20349 continue
20350
20351 switch (characters += Utility_from(character), character * variable) {
20352 // &
20353 case 38:
20354 ampersand = offset > 0 ? 1 : (characters += '\f', -1)
20355 break
20356 // ,
20357 case 44:
20358 points[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1
20359 break
20360 // @
20361 case 64:
20362 // -
20363 if (peek() === 45)
20364 characters += delimit(next())
20365
20366 atrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++
20367 break
20368 // -
20369 case 45:
20370 if (previous === 45 && strlen(characters) == 2)
20371 variable = 0
20372 }
20373 }
20374
20375 return rulesets
20376 }
20377
20378 /**
20379 * @param {string} value
20380 * @param {object} root
20381 * @param {object?} parent
20382 * @param {number} index
20383 * @param {number} offset
20384 * @param {string[]} rules
20385 * @param {number[]} points
20386 * @param {string} type
20387 * @param {string[]} props
20388 * @param {string[]} children
20389 * @param {number} length
20390 * @param {object[]} siblings
20391 * @return {object}
20392 */
20393 function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length, siblings) {
20394 var post = offset - 1
20395 var rule = offset === 0 ? rules : ['']
20396 var size = sizeof(rule)
20397
20398 for (var i = 0, j = 0, k = 0; i < index; ++i)
20399 for (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)
20400 if (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\f/g, rule[x])))
20401 props[k++] = z
20402
20403 return node(value, root, parent, offset === 0 ? RULESET : type, props, children, length, siblings)
20404 }
20405
20406 /**
20407 * @param {number} value
20408 * @param {object} root
20409 * @param {object?} parent
20410 * @param {object[]} siblings
20411 * @return {object}
20412 */
20413 function comment (value, root, parent, siblings) {
20414 return node(value, root, parent, COMMENT, Utility_from(Tokenizer_char()), substr(value, 2, -2), 0, siblings)
20415 }
20416
20417 /**
20418 * @param {string} value
20419 * @param {object} root
20420 * @param {object?} parent
20421 * @param {number} length
20422 * @param {object[]} siblings
20423 * @return {object}
20424 */
20425 function declaration (value, root, parent, length, siblings) {
20426 return node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length, siblings)
20427 }
20428
20429 // EXTERNAL MODULE: ../node_modules/dompurify/dist/purify.es.mjs
20430 var purify_es = __webpack_require__(4719);
20431 // EXTERNAL MODULE: ../node_modules/lodash-es/isEmpty.js
20432 var isEmpty = __webpack_require__(66400);
20433 ;// CONCATENATED MODULE: ../node_modules/mermaid/dist/mermaid.core.mjs
20434
20435
20436
20437
20438
20439
20440
20441
20442
20443
20444
20445
20446
20447 // src/mermaid.ts
20448
20449
20450 // src/diagrams/c4/c4Detector.ts
20451 var id = "c4";
20452 var detector = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((txt) => {
20453 return /^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(txt);
20454 }, "detector");
20455 var loader = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(async () => {
20456 const { diagram: diagram2 } = await __webpack_require__.e(/* import() */ 145).then(__webpack_require__.bind(__webpack_require__, 60145));
20457 return { id, diagram: diagram2 };
20458 }, "loader");
20459 var mermaid_core_plugin = {
20460 id,
20461 detector,
20462 loader
20463 };
20464 var c4Detector_default = mermaid_core_plugin;
20465
20466 // src/diagrams/flowchart/flowDetector.ts
20467 var id2 = "flowchart";
20468 var detector2 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((txt, config) => {
20469 if (config?.flowchart?.defaultRenderer === "dagre-wrapper" || config?.flowchart?.defaultRenderer === "elk") {
20470 return false;
20471 }
20472 return /^\s*graph/.test(txt);
20473 }, "detector");
20474 var loader2 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(async () => {
20475 const { diagram: diagram2 } = await __webpack_require__.e(/* import() */ 2409).then(__webpack_require__.bind(__webpack_require__, 82409));
20476 return { id: id2, diagram: diagram2 };
20477 }, "loader");
20478 var plugin2 = {
20479 id: id2,
20480 detector: detector2,
20481 loader: loader2
20482 };
20483 var flowDetector_default = plugin2;
20484
20485 // src/diagrams/flowchart/flowDetector-v2.ts
20486 var id3 = "flowchart-v2";
20487 var detector3 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((txt, config) => {
20488 if (config?.flowchart?.defaultRenderer === "dagre-d3") {
20489 return false;
20490 }
20491 if (config?.flowchart?.defaultRenderer === "elk") {
20492 config.layout = "elk";
20493 }
20494 if (/^\s*graph/.test(txt) && config?.flowchart?.defaultRenderer === "dagre-wrapper") {
20495 return true;
20496 }
20497 return /^\s*flowchart/.test(txt);
20498 }, "detector");
20499 var loader3 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(async () => {
20500 const { diagram: diagram2 } = await __webpack_require__.e(/* import() */ 2409).then(__webpack_require__.bind(__webpack_require__, 82409));
20501 return { id: id3, diagram: diagram2 };
20502 }, "loader");
20503 var plugin3 = {
20504 id: id3,
20505 detector: detector3,
20506 loader: loader3
20507 };
20508 var flowDetector_v2_default = plugin3;
20509
20510 // src/diagrams/er/erDetector.ts
20511 var id4 = "er";
20512 var detector4 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((txt) => {
20513 return /^\s*erDiagram/.test(txt);
20514 }, "detector");
20515 var loader4 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(async () => {
20516 const { diagram: diagram2 } = await __webpack_require__.e(/* import() */ 7488).then(__webpack_require__.bind(__webpack_require__, 57488));
20517 return { id: id4, diagram: diagram2 };
20518 }, "loader");
20519 var plugin4 = {
20520 id: id4,
20521 detector: detector4,
20522 loader: loader4
20523 };
20524 var erDetector_default = plugin4;
20525
20526 // src/diagrams/git/gitGraphDetector.ts
20527 var id5 = "gitGraph";
20528 var detector5 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((txt) => {
20529 return /^\s*gitGraph/.test(txt);
20530 }, "detector");
20531 var loader5 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(async () => {
20532 const { diagram: diagram2 } = await Promise.all(/* import() */[__webpack_require__.e(2228), __webpack_require__.e(3197), __webpack_require__.e(5748)]).then(__webpack_require__.bind(__webpack_require__, 85748));
20533 return { id: id5, diagram: diagram2 };
20534 }, "loader");
20535 var plugin5 = {
20536 id: id5,
20537 detector: detector5,
20538 loader: loader5
20539 };
20540 var gitGraphDetector_default = plugin5;
20541
20542 // src/diagrams/gantt/ganttDetector.ts
20543 var id6 = "gantt";
20544 var detector6 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((txt) => {
20545 return /^\s*gantt/.test(txt);
20546 }, "detector");
20547 var loader6 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(async () => {
20548 const { diagram: diagram2 } = await __webpack_require__.e(/* import() */ 6873).then(__webpack_require__.bind(__webpack_require__, 76873));
20549 return { id: id6, diagram: diagram2 };
20550 }, "loader");
20551 var plugin6 = {
20552 id: id6,
20553 detector: detector6,
20554 loader: loader6
20555 };
20556 var ganttDetector_default = plugin6;
20557
20558 // src/diagrams/info/infoDetector.ts
20559 var id7 = "info";
20560 var detector7 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((txt) => {
20561 return /^\s*info/.test(txt);
20562 }, "detector");
20563 var loader7 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(async () => {
20564 const { diagram: diagram2 } = await Promise.all(/* import() */[__webpack_require__.e(2228), __webpack_require__.e(3197), __webpack_require__.e(5872)]).then(__webpack_require__.bind(__webpack_require__, 45872));
20565 return { id: id7, diagram: diagram2 };
20566 }, "loader");
20567 var info = {
20568 id: id7,
20569 detector: detector7,
20570 loader: loader7
20571 };
20572
20573 // src/diagrams/pie/pieDetector.ts
20574 var id8 = "pie";
20575 var detector8 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((txt) => {
20576 return /^\s*pie/.test(txt);
20577 }, "detector");
20578 var loader8 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(async () => {
20579 const { diagram: diagram2 } = await Promise.all(/* import() */[__webpack_require__.e(2228), __webpack_require__.e(3197), __webpack_require__.e(874)]).then(__webpack_require__.bind(__webpack_require__, 30874));
20580 return { id: id8, diagram: diagram2 };
20581 }, "loader");
20582 var pie = {
20583 id: id8,
20584 detector: detector8,
20585 loader: loader8
20586 };
20587
20588 // src/diagrams/quadrant-chart/quadrantDetector.ts
20589 var id9 = "quadrantChart";
20590 var detector9 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((txt) => {
20591 return /^\s*quadrantChart/.test(txt);
20592 }, "detector");
20593 var loader9 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(async () => {
20594 const { diagram: diagram2 } = await __webpack_require__.e(/* import() */ 7159).then(__webpack_require__.bind(__webpack_require__, 87159));
20595 return { id: id9, diagram: diagram2 };
20596 }, "loader");
20597 var plugin7 = {
20598 id: id9,
20599 detector: detector9,
20600 loader: loader9
20601 };
20602 var quadrantDetector_default = plugin7;
20603
20604 // src/diagrams/xychart/xychartDetector.ts
20605 var id10 = "xychart";
20606 var detector10 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((txt) => {
20607 return /^\s*xychart-beta/.test(txt);
20608 }, "detector");
20609 var loader10 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(async () => {
20610 const { diagram: diagram2 } = await __webpack_require__.e(/* import() */ 6491).then(__webpack_require__.bind(__webpack_require__, 86491));
20611 return { id: id10, diagram: diagram2 };
20612 }, "loader");
20613 var plugin8 = {
20614 id: id10,
20615 detector: detector10,
20616 loader: loader10
20617 };
20618 var xychartDetector_default = plugin8;
20619
20620 // src/diagrams/requirement/requirementDetector.ts
20621 var id11 = "requirement";
20622 var detector11 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((txt) => {
20623 return /^\s*requirement(Diagram)?/.test(txt);
20624 }, "detector");
20625 var loader11 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(async () => {
20626 const { diagram: diagram2 } = await __webpack_require__.e(/* import() */ 2019).then(__webpack_require__.bind(__webpack_require__, 42019));
20627 return { id: id11, diagram: diagram2 };
20628 }, "loader");
20629 var plugin9 = {
20630 id: id11,
20631 detector: detector11,
20632 loader: loader11
20633 };
20634 var requirementDetector_default = plugin9;
20635
20636 // src/diagrams/sequence/sequenceDetector.ts
20637 var id12 = "sequence";
20638 var detector12 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((txt) => {
20639 return /^\s*sequenceDiagram/.test(txt);
20640 }, "detector");
20641 var loader12 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(async () => {
20642 const { diagram: diagram2 } = await __webpack_require__.e(/* import() */ 2453).then(__webpack_require__.bind(__webpack_require__, 62453));
20643 return { id: id12, diagram: diagram2 };
20644 }, "loader");
20645 var plugin10 = {
20646 id: id12,
20647 detector: detector12,
20648 loader: loader12
20649 };
20650 var sequenceDetector_default = plugin10;
20651
20652 // src/diagrams/class/classDetector.ts
20653 var id13 = "class";
20654 var detector13 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((txt, config) => {
20655 if (config?.class?.defaultRenderer === "dagre-wrapper") {
20656 return false;
20657 }
20658 return /^\s*classDiagram/.test(txt);
20659 }, "detector");
20660 var loader13 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(async () => {
20661 const { diagram: diagram2 } = await Promise.all(/* import() */[__webpack_require__.e(4886), __webpack_require__.e(777)]).then(__webpack_require__.bind(__webpack_require__, 40777));
20662 return { id: id13, diagram: diagram2 };
20663 }, "loader");
20664 var plugin11 = {
20665 id: id13,
20666 detector: detector13,
20667 loader: loader13
20668 };
20669 var classDetector_default = plugin11;
20670
20671 // src/diagrams/class/classDetector-V2.ts
20672 var id14 = "classDiagram";
20673 var detector14 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((txt, config) => {
20674 if (/^\s*classDiagram/.test(txt) && config?.class?.defaultRenderer === "dagre-wrapper") {
20675 return true;
20676 }
20677 return /^\s*classDiagram-v2/.test(txt);
20678 }, "detector");
20679 var loader14 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(async () => {
20680 const { diagram: diagram2 } = await Promise.all(/* import() */[__webpack_require__.e(4886), __webpack_require__.e(8678)]).then(__webpack_require__.bind(__webpack_require__, 8678));
20681 return { id: id14, diagram: diagram2 };
20682 }, "loader");
20683 var plugin12 = {
20684 id: id14,
20685 detector: detector14,
20686 loader: loader14
20687 };
20688 var classDetector_V2_default = plugin12;
20689
20690 // src/diagrams/state/stateDetector.ts
20691 var id15 = "state";
20692 var detector15 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((txt, config) => {
20693 if (config?.state?.defaultRenderer === "dagre-wrapper") {
20694 return false;
20695 }
20696 return /^\s*stateDiagram/.test(txt);
20697 }, "detector");
20698 var loader15 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(async () => {
20699 const { diagram: diagram2 } = await Promise.all(/* import() */[__webpack_require__.e(2228), __webpack_require__.e(4276), __webpack_require__.e(8218), __webpack_require__.e(6301)]).then(__webpack_require__.bind(__webpack_require__, 66301));
20700 return { id: id15, diagram: diagram2 };
20701 }, "loader");
20702 var plugin13 = {
20703 id: id15,
20704 detector: detector15,
20705 loader: loader15
20706 };
20707 var stateDetector_default = plugin13;
20708
20709 // src/diagrams/state/stateDetector-V2.ts
20710 var id16 = "stateDiagram";
20711 var detector16 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((txt, config) => {
20712 if (/^\s*stateDiagram-v2/.test(txt)) {
20713 return true;
20714 }
20715 if (/^\s*stateDiagram/.test(txt) && config?.state?.defaultRenderer === "dagre-wrapper") {
20716 return true;
20717 }
20718 return false;
20719 }, "detector");
20720 var loader16 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(async () => {
20721 const { diagram: diagram2 } = await Promise.all(/* import() */[__webpack_require__.e(8218), __webpack_require__.e(841)]).then(__webpack_require__.bind(__webpack_require__, 50841));
20722 return { id: id16, diagram: diagram2 };
20723 }, "loader");
20724 var plugin14 = {
20725 id: id16,
20726 detector: detector16,
20727 loader: loader16
20728 };
20729 var stateDetector_V2_default = plugin14;
20730
20731 // src/diagrams/user-journey/journeyDetector.ts
20732 var id17 = "journey";
20733 var detector17 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((txt) => {
20734 return /^\s*journey/.test(txt);
20735 }, "detector");
20736 var loader17 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(async () => {
20737 const { diagram: diagram2 } = await __webpack_require__.e(/* import() */ 1939).then(__webpack_require__.bind(__webpack_require__, 11939));
20738 return { id: id17, diagram: diagram2 };
20739 }, "loader");
20740 var plugin15 = {
20741 id: id17,
20742 detector: detector17,
20743 loader: loader17
20744 };
20745 var journeyDetector_default = plugin15;
20746
20747 // src/diagrams/error/errorRenderer.ts
20748 var draw = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((_text, id27, version) => {
20749 chunk_YTJNT7DU/* log */.cM.debug("rendering svg for syntax error\n");
20750 const svg = (0,chunk_7B677QYD/* selectSvgElement */.P)(id27);
20751 const g = svg.append("g");
20752 svg.attr("viewBox", "0 0 2412 512");
20753 (0,chunk_YTJNT7DU/* configureSvgSize */.v2)(svg, 100, 512, true);
20754 g.append("path").attr("class", "error-icon").attr(
20755 "d",
20756 "m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"
20757 );
20758 g.append("path").attr("class", "error-icon").attr(
20759 "d",
20760 "m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"
20761 );
20762 g.append("path").attr("class", "error-icon").attr(
20763 "d",
20764 "m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"
20765 );
20766 g.append("path").attr("class", "error-icon").attr(
20767 "d",
20768 "m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"
20769 );
20770 g.append("path").attr("class", "error-icon").attr(
20771 "d",
20772 "m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"
20773 );
20774 g.append("path").attr("class", "error-icon").attr(
20775 "d",
20776 "m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"
20777 );
20778 g.append("text").attr("class", "error-text").attr("x", 1440).attr("y", 250).attr("font-size", "150px").style("text-anchor", "middle").text("Syntax error in text");
20779 g.append("text").attr("class", "error-text").attr("x", 1250).attr("y", 400).attr("font-size", "100px").style("text-anchor", "middle").text(`mermaid version ${version}`);
20780 }, "draw");
20781 var renderer = { draw };
20782 var errorRenderer_default = renderer;
20783
20784 // src/diagrams/error/errorDiagram.ts
20785 var diagram = {
20786 db: {},
20787 renderer,
20788 parser: {
20789 parse: /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(() => {
20790 return;
20791 }, "parse")
20792 }
20793 };
20794 var errorDiagram_default = diagram;
20795
20796 // src/diagrams/flowchart/elk/detector.ts
20797 var id18 = "flowchart-elk";
20798 var detector18 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((txt, config = {}) => {
20799 if (
20800 // If diagram explicitly states flowchart-elk
20801 /^\s*flowchart-elk/.test(txt) || // If a flowchart/graph diagram has their default renderer set to elk
20802 /^\s*flowchart|graph/.test(txt) && config?.flowchart?.defaultRenderer === "elk"
20803 ) {
20804 config.layout = "elk";
20805 return true;
20806 }
20807 return false;
20808 }, "detector");
20809 var loader18 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(async () => {
20810 const { diagram: diagram2 } = await __webpack_require__.e(/* import() */ 2409).then(__webpack_require__.bind(__webpack_require__, 82409));
20811 return { id: id18, diagram: diagram2 };
20812 }, "loader");
20813 var plugin16 = {
20814 id: id18,
20815 detector: detector18,
20816 loader: loader18
20817 };
20818 var detector_default = plugin16;
20819
20820 // src/diagrams/timeline/detector.ts
20821 var id19 = "timeline";
20822 var detector19 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((txt) => {
20823 return /^\s*timeline/.test(txt);
20824 }, "detector");
20825 var loader19 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(async () => {
20826 const { diagram: diagram2 } = await __webpack_require__.e(/* import() */ 4667).then(__webpack_require__.bind(__webpack_require__, 54667));
20827 return { id: id19, diagram: diagram2 };
20828 }, "loader");
20829 var plugin17 = {
20830 id: id19,
20831 detector: detector19,
20832 loader: loader19
20833 };
20834 var detector_default2 = plugin17;
20835
20836 // src/diagrams/mindmap/detector.ts
20837 var id20 = "mindmap";
20838 var detector20 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((txt) => {
20839 return /^\s*mindmap/.test(txt);
20840 }, "detector");
20841 var loader20 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(async () => {
20842 const { diagram: diagram2 } = await Promise.all(/* import() */[__webpack_require__.e(3207), __webpack_require__.e(310)]).then(__webpack_require__.bind(__webpack_require__, 80310));
20843 return { id: id20, diagram: diagram2 };
20844 }, "loader");
20845 var plugin18 = {
20846 id: id20,
20847 detector: detector20,
20848 loader: loader20
20849 };
20850 var detector_default3 = plugin18;
20851
20852 // src/diagrams/kanban/detector.ts
20853 var id21 = "kanban";
20854 var detector21 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((txt) => {
20855 return /^\s*kanban/.test(txt);
20856 }, "detector");
20857 var loader21 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(async () => {
20858 const { diagram: diagram2 } = await __webpack_require__.e(/* import() */ 6428).then(__webpack_require__.bind(__webpack_require__, 66428));
20859 return { id: id21, diagram: diagram2 };
20860 }, "loader");
20861 var plugin19 = {
20862 id: id21,
20863 detector: detector21,
20864 loader: loader21
20865 };
20866 var detector_default4 = plugin19;
20867
20868 // src/diagrams/sankey/sankeyDetector.ts
20869 var id22 = "sankey";
20870 var detector22 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((txt) => {
20871 return /^\s*sankey-beta/.test(txt);
20872 }, "detector");
20873 var loader22 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(async () => {
20874 const { diagram: diagram2 } = await __webpack_require__.e(/* import() */ 9442).then(__webpack_require__.bind(__webpack_require__, 69442));
20875 return { id: id22, diagram: diagram2 };
20876 }, "loader");
20877 var plugin20 = {
20878 id: id22,
20879 detector: detector22,
20880 loader: loader22
20881 };
20882 var sankeyDetector_default = plugin20;
20883
20884 // src/diagrams/packet/detector.ts
20885 var id23 = "packet";
20886 var detector23 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((txt) => {
20887 return /^\s*packet-beta/.test(txt);
20888 }, "detector");
20889 var loader23 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(async () => {
20890 const { diagram: diagram2 } = await Promise.all(/* import() */[__webpack_require__.e(2228), __webpack_require__.e(3197), __webpack_require__.e(2581)]).then(__webpack_require__.bind(__webpack_require__, 12581));
20891 return { id: id23, diagram: diagram2 };
20892 }, "loader");
20893 var packet = {
20894 id: id23,
20895 detector: detector23,
20896 loader: loader23
20897 };
20898
20899 // src/diagrams/radar/detector.ts
20900 var id24 = "radar";
20901 var detector24 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((txt) => {
20902 return /^\s*radar-beta/.test(txt);
20903 }, "detector");
20904 var loader24 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(async () => {
20905 const { diagram: diagram2 } = await Promise.all(/* import() */[__webpack_require__.e(2228), __webpack_require__.e(3197), __webpack_require__.e(3782)]).then(__webpack_require__.bind(__webpack_require__, 3782));
20906 return { id: id24, diagram: diagram2 };
20907 }, "loader");
20908 var radar = {
20909 id: id24,
20910 detector: detector24,
20911 loader: loader24
20912 };
20913
20914 // src/diagrams/block/blockDetector.ts
20915 var id25 = "block";
20916 var detector25 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((txt) => {
20917 return /^\s*block-beta/.test(txt);
20918 }, "detector");
20919 var loader25 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(async () => {
20920 const { diagram: diagram2 } = await Promise.all(/* import() */[__webpack_require__.e(2228), __webpack_require__.e(1950)]).then(__webpack_require__.bind(__webpack_require__, 31950));
20921 return { id: id25, diagram: diagram2 };
20922 }, "loader");
20923 var plugin21 = {
20924 id: id25,
20925 detector: detector25,
20926 loader: loader25
20927 };
20928 var blockDetector_default = plugin21;
20929
20930 // src/diagrams/architecture/architectureDetector.ts
20931 var id26 = "architecture";
20932 var detector26 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((txt) => {
20933 return /^\s*architecture/.test(txt);
20934 }, "detector");
20935 var loader26 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(async () => {
20936 const { diagram: diagram2 } = await Promise.all(/* import() */[__webpack_require__.e(2228), __webpack_require__.e(3197), __webpack_require__.e(3207), __webpack_require__.e(2425)]).then(__webpack_require__.bind(__webpack_require__, 72425));
20937 return { id: id26, diagram: diagram2 };
20938 }, "loader");
20939 var architecture = {
20940 id: id26,
20941 detector: detector26,
20942 loader: loader26
20943 };
20944 var architectureDetector_default = architecture;
20945
20946 // src/diagram-api/diagram-orchestration.ts
20947 var hasLoadedDiagrams = false;
20948 var addDiagrams = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(() => {
20949 if (hasLoadedDiagrams) {
20950 return;
20951 }
20952 hasLoadedDiagrams = true;
20953 (0,chunk_YTJNT7DU/* registerDiagram */.Cq)("error", errorDiagram_default, (text) => {
20954 return text.toLowerCase().trim() === "error";
20955 });
20956 (0,chunk_YTJNT7DU/* registerDiagram */.Cq)(
20957 "---",
20958 // --- diagram type may appear if YAML front-matter is not parsed correctly
20959 {
20960 db: {
20961 clear: /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(() => {
20962 }, "clear")
20963 },
20964 styles: {},
20965 // should never be used
20966 renderer: {
20967 draw: /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(() => {
20968 }, "draw")
20969 },
20970 parser: {
20971 parse: /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(() => {
20972 throw new Error(
20973 "Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks"
20974 );
20975 }, "parse")
20976 },
20977 init: /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(() => null, "init")
20978 // no op
20979 },
20980 (text) => {
20981 return text.toLowerCase().trimStart().startsWith("---");
20982 }
20983 );
20984 (0,chunk_YTJNT7DU/* registerLazyLoadedDiagrams */.KO)(
20985 c4Detector_default,
20986 detector_default4,
20987 classDetector_V2_default,
20988 classDetector_default,
20989 erDetector_default,
20990 ganttDetector_default,
20991 info,
20992 pie,
20993 requirementDetector_default,
20994 sequenceDetector_default,
20995 detector_default,
20996 flowDetector_v2_default,
20997 flowDetector_default,
20998 detector_default3,
20999 detector_default2,
21000 gitGraphDetector_default,
21001 stateDetector_V2_default,
21002 stateDetector_default,
21003 journeyDetector_default,
21004 quadrantDetector_default,
21005 sankeyDetector_default,
21006 packet,
21007 xychartDetector_default,
21008 blockDetector_default,
21009 architectureDetector_default,
21010 radar
21011 );
21012 }, "addDiagrams");
21013
21014 // src/diagram-api/loadDiagram.ts
21015 var loadRegisteredDiagrams = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(async () => {
21016 chunk_YTJNT7DU/* log */.cM.debug(`Loading registered diagrams`);
21017 const results = await Promise.allSettled(
21018 Object.entries(chunk_YTJNT7DU/* detectors */.Bf).map(async ([key, { detector: detector27, loader: loader27 }]) => {
21019 if (loader27) {
21020 try {
21021 (0,chunk_YTJNT7DU/* getDiagram */._7)(key);
21022 } catch {
21023 try {
21024 const { diagram: diagram2, id: id27 } = await loader27();
21025 (0,chunk_YTJNT7DU/* registerDiagram */.Cq)(id27, diagram2, detector27);
21026 } catch (err) {
21027 chunk_YTJNT7DU/* log */.cM.error(`Failed to load external diagram with key ${key}. Removing from detectors.`);
21028 delete chunk_YTJNT7DU/* detectors */.Bf[key];
21029 throw err;
21030 }
21031 }
21032 }
21033 })
21034 );
21035 const failed = results.filter((result) => result.status === "rejected");
21036 if (failed.length > 0) {
21037 chunk_YTJNT7DU/* log */.cM.error(`Failed to load ${failed.length} external diagrams`);
21038 for (const res of failed) {
21039 chunk_YTJNT7DU/* log */.cM.error(res);
21040 }
21041 throw new Error(`Failed to load ${failed.length} external diagrams`);
21042 }
21043 }, "loadRegisteredDiagrams");
21044
21045 // src/mermaidAPI.ts
21046
21047
21048
21049
21050
21051 // src/accessibility.ts
21052 var SVG_ROLE = "graphics-document document";
21053 function setA11yDiagramInfo(svg, diagramType) {
21054 svg.attr("role", SVG_ROLE);
21055 if (diagramType !== "") {
21056 svg.attr("aria-roledescription", diagramType);
21057 }
21058 }
21059 (0,chunk_YTJNT7DU/* __name */.eW)(setA11yDiagramInfo, "setA11yDiagramInfo");
21060 function addSVGa11yTitleDescription(svg, a11yTitle, a11yDesc, baseId) {
21061 if (svg.insert === void 0) {
21062 return;
21063 }
21064 if (a11yDesc) {
21065 const descId = `chart-desc-${baseId}`;
21066 svg.attr("aria-describedby", descId);
21067 svg.insert("desc", ":first-child").attr("id", descId).text(a11yDesc);
21068 }
21069 if (a11yTitle) {
21070 const titleId = `chart-title-${baseId}`;
21071 svg.attr("aria-labelledby", titleId);
21072 svg.insert("title", ":first-child").attr("id", titleId).text(a11yTitle);
21073 }
21074 }
21075 (0,chunk_YTJNT7DU/* __name */.eW)(addSVGa11yTitleDescription, "addSVGa11yTitleDescription");
21076
21077 // src/Diagram.ts
21078 var Diagram = class _Diagram {
21079 constructor(type, text, db, parser, renderer2) {
21080 this.type = type;
21081 this.text = text;
21082 this.db = db;
21083 this.parser = parser;
21084 this.renderer = renderer2;
21085 }
21086 static {
21087 (0,chunk_YTJNT7DU/* __name */.eW)(this, "Diagram");
21088 }
21089 static async fromText(text, metadata = {}) {
21090 const config = (0,chunk_YTJNT7DU/* getConfig */.iE)();
21091 const type = (0,chunk_YTJNT7DU/* detectType */.Vg)(text, config);
21092 text = (0,chunk_O4NI6UNU/* encodeEntities */.Vy)(text) + "\n";
21093 try {
21094 (0,chunk_YTJNT7DU/* getDiagram */._7)(type);
21095 } catch {
21096 const loader27 = (0,chunk_YTJNT7DU/* getDiagramLoader */.cq)(type);
21097 if (!loader27) {
21098 throw new chunk_YTJNT7DU/* UnknownDiagramError */.cj(`Diagram ${type} not found.`);
21099 }
21100 const { id: id27, diagram: diagram2 } = await loader27();
21101 (0,chunk_YTJNT7DU/* registerDiagram */.Cq)(id27, diagram2);
21102 }
21103 const { db, parser, renderer: renderer2, init: init2 } = (0,chunk_YTJNT7DU/* getDiagram */._7)(type);
21104 if (parser.parser) {
21105 parser.parser.yy = db;
21106 }
21107 db.clear?.();
21108 init2?.(config);
21109 if (metadata.title) {
21110 db.setDiagramTitle?.(metadata.title);
21111 }
21112 await parser.parse(text);
21113 return new _Diagram(type, text, db, parser, renderer2);
21114 }
21115 async render(id27, version) {
21116 await this.renderer.draw(this.text, id27, version, this);
21117 }
21118 getParser() {
21119 return this.parser;
21120 }
21121 getType() {
21122 return this.type;
21123 }
21124 };
21125
21126 // src/interactionDb.ts
21127 var interactionFunctions = [];
21128 var attachFunctions = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(() => {
21129 interactionFunctions.forEach((f) => {
21130 f();
21131 });
21132 interactionFunctions = [];
21133 }, "attachFunctions");
21134
21135 // src/diagram-api/comments.ts
21136 var cleanupComments = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((text) => {
21137 return text.replace(/^\s*%%(?!{)[^\n]+\n?/gm, "").trimStart();
21138 }, "cleanupComments");
21139
21140 // src/diagram-api/frontmatter.ts
21141 function extractFrontMatter(text) {
21142 const matches = text.match(chunk_YTJNT7DU/* frontMatterRegex */.M6);
21143 if (!matches) {
21144 return {
21145 text,
21146 metadata: {}
21147 };
21148 }
21149 let parsed = (0,chunk_6JRP7KZX/* load */.z)(matches[1], {
21150 // To support config, we need JSON schema.
21151 // https://www.yaml.org/spec/1.2/spec.html#id2803231
21152 schema: chunk_6JRP7KZX/* JSON_SCHEMA */.A
21153 }) ?? {};
21154 parsed = typeof parsed === "object" && !Array.isArray(parsed) ? parsed : {};
21155 const metadata = {};
21156 if (parsed.displayMode) {
21157 metadata.displayMode = parsed.displayMode.toString();
21158 }
21159 if (parsed.title) {
21160 metadata.title = parsed.title.toString();
21161 }
21162 if (parsed.config) {
21163 metadata.config = parsed.config;
21164 }
21165 return {
21166 text: text.slice(matches[0].length),
21167 metadata
21168 };
21169 }
21170 (0,chunk_YTJNT7DU/* __name */.eW)(extractFrontMatter, "extractFrontMatter");
21171
21172 // src/preprocess.ts
21173 var cleanupText = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((code) => {
21174 return code.replace(/\r\n?/g, "\n").replace(
21175 /<(\w+)([^>]*)>/g,
21176 (match, tag, attributes) => "<" + tag + attributes.replace(/="([^"]*)"/g, "='$1'") + ">"
21177 );
21178 }, "cleanupText");
21179 var processFrontmatter = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((code) => {
21180 const { text, metadata } = extractFrontMatter(code);
21181 const { displayMode, title, config = {} } = metadata;
21182 if (displayMode) {
21183 if (!config.gantt) {
21184 config.gantt = {};
21185 }
21186 config.gantt.displayMode = displayMode;
21187 }
21188 return { title, config, text };
21189 }, "processFrontmatter");
21190 var processDirectives = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((code) => {
21191 const initDirective = chunk_O4NI6UNU/* utils_default */.w8.detectInit(code) ?? {};
21192 const wrapDirectives = chunk_O4NI6UNU/* utils_default */.w8.detectDirective(code, "wrap");
21193 if (Array.isArray(wrapDirectives)) {
21194 initDirective.wrap = wrapDirectives.some(({ type }) => type === "wrap");
21195 } else if (wrapDirectives?.type === "wrap") {
21196 initDirective.wrap = true;
21197 }
21198 return {
21199 text: (0,chunk_O4NI6UNU/* removeDirectives */.tf)(code),
21200 directive: initDirective
21201 };
21202 }, "processDirectives");
21203 function preprocessDiagram(code) {
21204 const cleanedCode = cleanupText(code);
21205 const frontMatterResult = processFrontmatter(cleanedCode);
21206 const directiveResult = processDirectives(frontMatterResult.text);
21207 const config = (0,chunk_O4NI6UNU/* cleanAndMerge */.Rb)(frontMatterResult.config, directiveResult.directive);
21208 code = cleanupComments(directiveResult.text);
21209 return {
21210 code,
21211 title: frontMatterResult.title,
21212 config
21213 };
21214 }
21215 (0,chunk_YTJNT7DU/* __name */.eW)(preprocessDiagram, "preprocessDiagram");
21216
21217 // src/utils/base64.ts
21218 function toBase64(str) {
21219 const utf8Bytes = new TextEncoder().encode(str);
21220 const utf8Str = Array.from(utf8Bytes, (byte) => String.fromCodePoint(byte)).join("");
21221 return btoa(utf8Str);
21222 }
21223 (0,chunk_YTJNT7DU/* __name */.eW)(toBase64, "toBase64");
21224
21225 // src/mermaidAPI.ts
21226 var MAX_TEXTLENGTH = 5e4;
21227 var MAX_TEXTLENGTH_EXCEEDED_MSG = "graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa";
21228 var SECURITY_LVL_SANDBOX = "sandbox";
21229 var SECURITY_LVL_LOOSE = "loose";
21230 var XMLNS_SVG_STD = "http://www.w3.org/2000/svg";
21231 var XMLNS_XLINK_STD = "http://www.w3.org/1999/xlink";
21232 var XMLNS_XHTML_STD = "http://www.w3.org/1999/xhtml";
21233 var IFRAME_WIDTH = "100%";
21234 var IFRAME_HEIGHT = "100%";
21235 var IFRAME_STYLES = "border:0;margin:0;";
21236 var IFRAME_BODY_STYLE = "margin:0";
21237 var IFRAME_SANDBOX_OPTS = "allow-top-navigation-by-user-activation allow-popups";
21238 var IFRAME_NOT_SUPPORTED_MSG = 'The "iframe" tag is not supported by your browser.';
21239 var DOMPURIFY_TAGS = ["foreignobject"];
21240 var DOMPURIFY_ATTR = ["dominant-baseline"];
21241 function processAndSetConfigs(text) {
21242 const processed = preprocessDiagram(text);
21243 (0,chunk_YTJNT7DU/* reset */.mc)();
21244 (0,chunk_YTJNT7DU/* addDirective */.XV)(processed.config ?? {});
21245 return processed;
21246 }
21247 (0,chunk_YTJNT7DU/* __name */.eW)(processAndSetConfigs, "processAndSetConfigs");
21248 async function mermaid_core_parse(text, parseOptions) {
21249 addDiagrams();
21250 try {
21251 const { code, config } = processAndSetConfigs(text);
21252 const diagram2 = await getDiagramFromText(code);
21253 return { diagramType: diagram2.type, config };
21254 } catch (error) {
21255 if (parseOptions?.suppressErrors) {
21256 return false;
21257 }
21258 throw error;
21259 }
21260 }
21261 (0,chunk_YTJNT7DU/* __name */.eW)(mermaid_core_parse, "parse");
21262 var cssImportantStyles = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((cssClass, element, cssClasses = []) => {
21263 return `
21264 .${cssClass} ${element} { ${cssClasses.join(" !important; ")} !important; }`;
21265 }, "cssImportantStyles");
21266 var createCssStyles = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((config, classDefs = /* @__PURE__ */ new Map()) => {
21267 let cssStyles = "";
21268 if (config.themeCSS !== void 0) {
21269 cssStyles += `
21270 ${config.themeCSS}`;
21271 }
21272 if (config.fontFamily !== void 0) {
21273 cssStyles += `
21274 :root { --mermaid-font-family: ${config.fontFamily}}`;
21275 }
21276 if (config.altFontFamily !== void 0) {
21277 cssStyles += `
21278 :root { --mermaid-alt-font-family: ${config.altFontFamily}}`;
21279 }
21280 if (classDefs instanceof Map) {
21281 const htmlLabels = config.htmlLabels ?? config.flowchart?.htmlLabels;
21282 const cssHtmlElements = ["> *", "span"];
21283 const cssShapeElements = ["rect", "polygon", "ellipse", "circle", "path"];
21284 const cssElements = htmlLabels ? cssHtmlElements : cssShapeElements;
21285 classDefs.forEach((styleClassDef) => {
21286 if (!(0,isEmpty/* default */.Z)(styleClassDef.styles)) {
21287 cssElements.forEach((cssElement) => {
21288 cssStyles += cssImportantStyles(styleClassDef.id, cssElement, styleClassDef.styles);
21289 });
21290 }
21291 if (!(0,isEmpty/* default */.Z)(styleClassDef.textStyles)) {
21292 cssStyles += cssImportantStyles(
21293 styleClassDef.id,
21294 "tspan",
21295 (styleClassDef?.textStyles || []).map((s) => s.replace("color", "fill"))
21296 );
21297 }
21298 });
21299 }
21300 return cssStyles;
21301 }, "createCssStyles");
21302 var createUserStyles = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((config, graphType, classDefs, svgId) => {
21303 const userCSSstyles = createCssStyles(config, classDefs);
21304 const allStyles = (0,chunk_YTJNT7DU/* styles_default */.Ee)(graphType, userCSSstyles, config.themeVariables);
21305 return serialize(compile(`${svgId}{${allStyles}}`), stringify);
21306 }, "createUserStyles");
21307 var cleanUpSvgCode = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((svgCode = "", inSandboxMode, useArrowMarkerUrls) => {
21308 let cleanedUpSvg = svgCode;
21309 if (!useArrowMarkerUrls && !inSandboxMode) {
21310 cleanedUpSvg = cleanedUpSvg.replace(
21311 /marker-end="url\([\d+./:=?A-Za-z-]*?#/g,
21312 'marker-end="url(#'
21313 );
21314 }
21315 cleanedUpSvg = (0,chunk_O4NI6UNU/* decodeEntities */.SH)(cleanedUpSvg);
21316 cleanedUpSvg = cleanedUpSvg.replace(/<br>/g, "<br/>");
21317 return cleanedUpSvg;
21318 }, "cleanUpSvgCode");
21319 var putIntoIFrame = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((svgCode = "", svgElement) => {
21320 const height = svgElement?.viewBox?.baseVal?.height ? svgElement.viewBox.baseVal.height + "px" : IFRAME_HEIGHT;
21321 const base64encodedSrc = toBase64(`<body style="${IFRAME_BODY_STYLE}">${svgCode}</body>`);
21322 return `<iframe style="width:${IFRAME_WIDTH};height:${height};${IFRAME_STYLES}" src="data:text/html;charset=UTF-8;base64,${base64encodedSrc}" sandbox="${IFRAME_SANDBOX_OPTS}">
21323 ${IFRAME_NOT_SUPPORTED_MSG}
21324 </iframe>`;
21325 }, "putIntoIFrame");
21326 var appendDivSvgG = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((parentRoot, id27, enclosingDivId, divStyle, svgXlink) => {
21327 const enclosingDiv = parentRoot.append("div");
21328 enclosingDiv.attr("id", enclosingDivId);
21329 if (divStyle) {
21330 enclosingDiv.attr("style", divStyle);
21331 }
21332 const svgNode = enclosingDiv.append("svg").attr("id", id27).attr("width", "100%").attr("xmlns", XMLNS_SVG_STD);
21333 if (svgXlink) {
21334 svgNode.attr("xmlns:xlink", svgXlink);
21335 }
21336 svgNode.append("g");
21337 return parentRoot;
21338 }, "appendDivSvgG");
21339 function sandboxedIframe(parentNode, iFrameId) {
21340 return parentNode.append("iframe").attr("id", iFrameId).attr("style", "width: 100%; height: 100%;").attr("sandbox", "");
21341 }
21342 (0,chunk_YTJNT7DU/* __name */.eW)(sandboxedIframe, "sandboxedIframe");
21343 var removeExistingElements = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((doc, id27, divId, iFrameId) => {
21344 doc.getElementById(id27)?.remove();
21345 doc.getElementById(divId)?.remove();
21346 doc.getElementById(iFrameId)?.remove();
21347 }, "removeExistingElements");
21348 var render = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(async function(id27, text, svgContainingElement) {
21349 addDiagrams();
21350 const processed = processAndSetConfigs(text);
21351 text = processed.code;
21352 const config = (0,chunk_YTJNT7DU/* getConfig */.iE)();
21353 chunk_YTJNT7DU/* log */.cM.debug(config);
21354 if (text.length > (config?.maxTextSize ?? MAX_TEXTLENGTH)) {
21355 text = MAX_TEXTLENGTH_EXCEEDED_MSG;
21356 }
21357 const idSelector = "#" + id27;
21358 const iFrameID = "i" + id27;
21359 const iFrameID_selector = "#" + iFrameID;
21360 const enclosingDivID = "d" + id27;
21361 const enclosingDivID_selector = "#" + enclosingDivID;
21362 const removeTempElements = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(() => {
21363 const tmpElementSelector = isSandboxed ? iFrameID_selector : enclosingDivID_selector;
21364 const node = (0,src/* select */.Ys)(tmpElementSelector).node();
21365 if (node && "remove" in node) {
21366 node.remove();
21367 }
21368 }, "removeTempElements");
21369 let root = (0,src/* select */.Ys)("body");
21370 const isSandboxed = config.securityLevel === SECURITY_LVL_SANDBOX;
21371 const isLooseSecurityLevel = config.securityLevel === SECURITY_LVL_LOOSE;
21372 const fontFamily = config.fontFamily;
21373 if (svgContainingElement !== void 0) {
21374 if (svgContainingElement) {
21375 svgContainingElement.innerHTML = "";
21376 }
21377 if (isSandboxed) {
21378 const iframe = sandboxedIframe((0,src/* select */.Ys)(svgContainingElement), iFrameID);
21379 root = (0,src/* select */.Ys)(iframe.nodes()[0].contentDocument.body);
21380 root.node().style.margin = 0;
21381 } else {
21382 root = (0,src/* select */.Ys)(svgContainingElement);
21383 }
21384 appendDivSvgG(root, id27, enclosingDivID, `font-family: ${fontFamily}`, XMLNS_XLINK_STD);
21385 } else {
21386 removeExistingElements(document, id27, enclosingDivID, iFrameID);
21387 if (isSandboxed) {
21388 const iframe = sandboxedIframe((0,src/* select */.Ys)("body"), iFrameID);
21389 root = (0,src/* select */.Ys)(iframe.nodes()[0].contentDocument.body);
21390 root.node().style.margin = 0;
21391 } else {
21392 root = (0,src/* select */.Ys)("body");
21393 }
21394 appendDivSvgG(root, id27, enclosingDivID);
21395 }
21396 let diag;
21397 let parseEncounteredException;
21398 try {
21399 diag = await Diagram.fromText(text, { title: processed.title });
21400 } catch (error) {
21401 if (config.suppressErrorRendering) {
21402 removeTempElements();
21403 throw error;
21404 }
21405 diag = await Diagram.fromText("error");
21406 parseEncounteredException = error;
21407 }
21408 const element = root.select(enclosingDivID_selector).node();
21409 const diagramType = diag.type;
21410 const svg = element.firstChild;
21411 const firstChild = svg.firstChild;
21412 const diagramClassDefs = diag.renderer.getClasses?.(text, diag);
21413 const rules = createUserStyles(config, diagramType, diagramClassDefs, idSelector);
21414 const style1 = document.createElement("style");
21415 style1.innerHTML = rules;
21416 svg.insertBefore(style1, firstChild);
21417 try {
21418 await diag.renderer.draw(text, id27, chunk_5NNNAHNI/* package_default */.X.version, diag);
21419 } catch (e) {
21420 if (config.suppressErrorRendering) {
21421 removeTempElements();
21422 } else {
21423 errorRenderer_default.draw(text, id27, chunk_5NNNAHNI/* package_default */.X.version);
21424 }
21425 throw e;
21426 }
21427 const svgNode = root.select(`${enclosingDivID_selector} svg`);
21428 const a11yTitle = diag.db.getAccTitle?.();
21429 const a11yDescr = diag.db.getAccDescription?.();
21430 addA11yInfo(diagramType, svgNode, a11yTitle, a11yDescr);
21431 root.select(`[id="${id27}"]`).selectAll("foreignobject > *").attr("xmlns", XMLNS_XHTML_STD);
21432 let svgCode = root.select(enclosingDivID_selector).node().innerHTML;
21433 chunk_YTJNT7DU/* log */.cM.debug("config.arrowMarkerAbsolute", config.arrowMarkerAbsolute);
21434 svgCode = cleanUpSvgCode(svgCode, isSandboxed, (0,chunk_YTJNT7DU/* evaluate */.ku)(config.arrowMarkerAbsolute));
21435 if (isSandboxed) {
21436 const svgEl = root.select(enclosingDivID_selector + " svg").node();
21437 svgCode = putIntoIFrame(svgCode, svgEl);
21438 } else if (!isLooseSecurityLevel) {
21439 svgCode = purify_es/* default */.Z.sanitize(svgCode, {
21440 ADD_TAGS: DOMPURIFY_TAGS,
21441 ADD_ATTR: DOMPURIFY_ATTR,
21442 HTML_INTEGRATION_POINTS: { foreignobject: true }
21443 });
21444 }
21445 attachFunctions();
21446 if (parseEncounteredException) {
21447 throw parseEncounteredException;
21448 }
21449 removeTempElements();
21450 return {
21451 diagramType,
21452 svg: svgCode,
21453 bindFunctions: diag.db.bindFunctions
21454 };
21455 }, "render");
21456 function initialize(userOptions = {}) {
21457 const options = (0,chunk_YTJNT7DU/* assignWithDepth_default */.Yc)({}, userOptions);
21458 if (options?.fontFamily && !options.themeVariables?.fontFamily) {
21459 if (!options.themeVariables) {
21460 options.themeVariables = {};
21461 }
21462 options.themeVariables.fontFamily = options.fontFamily;
21463 }
21464 (0,chunk_YTJNT7DU/* saveConfigFromInitialize */.dY)(options);
21465 if (options?.theme && options.theme in chunk_YTJNT7DU/* themes_default */._j) {
21466 options.themeVariables = chunk_YTJNT7DU/* themes_default */._j[options.theme].getThemeVariables(
21467 options.themeVariables
21468 );
21469 } else if (options) {
21470 options.themeVariables = chunk_YTJNT7DU/* themes_default */._j.default.getThemeVariables(options.themeVariables);
21471 }
21472 const config = typeof options === "object" ? (0,chunk_YTJNT7DU/* setSiteConfig */.Yn)(options) : (0,chunk_YTJNT7DU/* getSiteConfig */.ZD)();
21473 (0,chunk_YTJNT7DU/* setLogLevel */.Ub)(config.logLevel);
21474 addDiagrams();
21475 }
21476 (0,chunk_YTJNT7DU/* __name */.eW)(initialize, "initialize");
21477 var getDiagramFromText = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((text, metadata = {}) => {
21478 const { code } = preprocessDiagram(text);
21479 return Diagram.fromText(code, metadata);
21480 }, "getDiagramFromText");
21481 function addA11yInfo(diagramType, svgNode, a11yTitle, a11yDescr) {
21482 setA11yDiagramInfo(svgNode, diagramType);
21483 addSVGa11yTitleDescription(svgNode, a11yTitle, a11yDescr, svgNode.attr("id"));
21484 }
21485 (0,chunk_YTJNT7DU/* __name */.eW)(addA11yInfo, "addA11yInfo");
21486 var mermaidAPI = Object.freeze({
21487 render,
21488 parse: mermaid_core_parse,
21489 getDiagramFromText,
21490 initialize,
21491 getConfig: chunk_YTJNT7DU/* getConfig */.iE,
21492 setConfig: chunk_YTJNT7DU/* setConfig */.v6,
21493 getSiteConfig: chunk_YTJNT7DU/* getSiteConfig */.ZD,
21494 updateSiteConfig: chunk_YTJNT7DU/* updateSiteConfig */.Tb,
21495 reset: /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(() => {
21496 (0,chunk_YTJNT7DU/* reset */.mc)();
21497 }, "reset"),
21498 globalReset: /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(() => {
21499 (0,chunk_YTJNT7DU/* reset */.mc)(chunk_YTJNT7DU/* defaultConfig */.u_);
21500 }, "globalReset"),
21501 defaultConfig: chunk_YTJNT7DU/* defaultConfig */.u_
21502 });
21503 (0,chunk_YTJNT7DU/* setLogLevel */.Ub)((0,chunk_YTJNT7DU/* getConfig */.iE)().logLevel);
21504 (0,chunk_YTJNT7DU/* reset */.mc)((0,chunk_YTJNT7DU/* getConfig */.iE)());
21505
21506 // src/mermaid.ts
21507 var handleError = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((error, errors, parseError) => {
21508 chunk_YTJNT7DU/* log */.cM.warn(error);
21509 if ((0,chunk_O4NI6UNU/* isDetailedError */.bZ)(error)) {
21510 if (parseError) {
21511 parseError(error.str, error.hash);
21512 }
21513 errors.push({ ...error, message: error.str, error });
21514 } else {
21515 if (parseError) {
21516 parseError(error);
21517 }
21518 if (error instanceof Error) {
21519 errors.push({
21520 str: error.message,
21521 message: error.message,
21522 hash: error.name,
21523 error
21524 });
21525 }
21526 }
21527 }, "handleError");
21528 var run = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(async function(options = {
21529 querySelector: ".mermaid"
21530 }) {
21531 try {
21532 await runThrowsErrors(options);
21533 } catch (e) {
21534 if ((0,chunk_O4NI6UNU/* isDetailedError */.bZ)(e)) {
21535 chunk_YTJNT7DU/* log */.cM.error(e.str);
21536 }
21537 if (mermaid.parseError) {
21538 mermaid.parseError(e);
21539 }
21540 if (!options.suppressErrors) {
21541 chunk_YTJNT7DU/* log */.cM.error("Use the suppressErrors option to suppress these errors");
21542 throw e;
21543 }
21544 }
21545 }, "run");
21546 var runThrowsErrors = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(async function({ postRenderCallback, querySelector, nodes } = {
21547 querySelector: ".mermaid"
21548 }) {
21549 const conf = mermaidAPI.getConfig();
21550 chunk_YTJNT7DU/* log */.cM.debug(`${!postRenderCallback ? "No " : ""}Callback function found`);
21551 let nodesToProcess;
21552 if (nodes) {
21553 nodesToProcess = nodes;
21554 } else if (querySelector) {
21555 nodesToProcess = document.querySelectorAll(querySelector);
21556 } else {
21557 throw new Error("Nodes and querySelector are both undefined");
21558 }
21559 chunk_YTJNT7DU/* log */.cM.debug(`Found ${nodesToProcess.length} diagrams`);
21560 if (conf?.startOnLoad !== void 0) {
21561 chunk_YTJNT7DU/* log */.cM.debug("Start On Load: " + conf?.startOnLoad);
21562 mermaidAPI.updateSiteConfig({ startOnLoad: conf?.startOnLoad });
21563 }
21564 const idGenerator = new chunk_O4NI6UNU/* utils_default */.w8.InitIDGenerator(conf.deterministicIds, conf.deterministicIDSeed);
21565 let txt;
21566 const errors = [];
21567 for (const element of Array.from(nodesToProcess)) {
21568 chunk_YTJNT7DU/* log */.cM.info("Rendering diagram: " + element.id);
21569 if (element.getAttribute("data-processed")) {
21570 continue;
21571 }
21572 element.setAttribute("data-processed", "true");
21573 const id27 = `mermaid-${idGenerator.next()}`;
21574 txt = element.innerHTML;
21575 txt = (0,esm/* dedent */.Z)(chunk_O4NI6UNU/* utils_default */.w8.entityDecode(txt)).trim().replace(/<br\s*\/?>/gi, "<br/>");
21576 const init2 = chunk_O4NI6UNU/* utils_default */.w8.detectInit(txt);
21577 if (init2) {
21578 chunk_YTJNT7DU/* log */.cM.debug("Detected early reinit: ", init2);
21579 }
21580 try {
21581 const { svg, bindFunctions } = await render2(id27, txt, element);
21582 element.innerHTML = svg;
21583 if (postRenderCallback) {
21584 await postRenderCallback(id27);
21585 }
21586 if (bindFunctions) {
21587 bindFunctions(element);
21588 }
21589 } catch (error) {
21590 handleError(error, errors, mermaid.parseError);
21591 }
21592 }
21593 if (errors.length > 0) {
21594 throw errors[0];
21595 }
21596 }, "runThrowsErrors");
21597 var initialize2 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(function(config) {
21598 mermaidAPI.initialize(config);
21599 }, "initialize");
21600 var init = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(async function(config, nodes, callback) {
21601 chunk_YTJNT7DU/* log */.cM.warn("mermaid.init is deprecated. Please use run instead.");
21602 if (config) {
21603 initialize2(config);
21604 }
21605 const runOptions = { postRenderCallback: callback, querySelector: ".mermaid" };
21606 if (typeof nodes === "string") {
21607 runOptions.querySelector = nodes;
21608 } else if (nodes) {
21609 if (nodes instanceof HTMLElement) {
21610 runOptions.nodes = [nodes];
21611 } else {
21612 runOptions.nodes = nodes;
21613 }
21614 }
21615 await run(runOptions);
21616 }, "init");
21617 var registerExternalDiagrams = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(async (diagrams, {
21618 lazyLoad = true
21619 } = {}) => {
21620 addDiagrams();
21621 (0,chunk_YTJNT7DU/* registerLazyLoadedDiagrams */.KO)(...diagrams);
21622 if (lazyLoad === false) {
21623 await loadRegisteredDiagrams();
21624 }
21625 }, "registerExternalDiagrams");
21626 var contentLoaded = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(function() {
21627 if (mermaid.startOnLoad) {
21628 const { startOnLoad } = mermaidAPI.getConfig();
21629 if (startOnLoad) {
21630 mermaid.run().catch((err) => chunk_YTJNT7DU/* log */.cM.error("Mermaid failed to initialize", err));
21631 }
21632 }
21633 }, "contentLoaded");
21634 if (typeof document !== "undefined") {
21635 window.addEventListener("load", contentLoaded, false);
21636 }
21637 var setParseErrorHandler = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(function(parseErrorHandler) {
21638 mermaid.parseError = parseErrorHandler;
21639 }, "setParseErrorHandler");
21640 var executionQueue = [];
21641 var executionQueueRunning = false;
21642 var executeQueue = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(async () => {
21643 if (executionQueueRunning) {
21644 return;
21645 }
21646 executionQueueRunning = true;
21647 while (executionQueue.length > 0) {
21648 const f = executionQueue.shift();
21649 if (f) {
21650 try {
21651 await f();
21652 } catch (e) {
21653 chunk_YTJNT7DU/* log */.cM.error("Error executing queue", e);
21654 }
21655 }
21656 }
21657 executionQueueRunning = false;
21658 }, "executeQueue");
21659 var parse2 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(async (text, parseOptions) => {
21660 return new Promise((resolve, reject) => {
21661 const performCall = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(() => new Promise((res, rej) => {
21662 mermaidAPI.parse(text, parseOptions).then(
21663 (r) => {
21664 res(r);
21665 resolve(r);
21666 },
21667 (e) => {
21668 chunk_YTJNT7DU/* log */.cM.error("Error parsing", e);
21669 mermaid.parseError?.(e);
21670 rej(e);
21671 reject(e);
21672 }
21673 );
21674 }), "performCall");
21675 executionQueue.push(performCall);
21676 executeQueue().catch(reject);
21677 });
21678 }, "parse");
21679 var render2 = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)((id27, text, container) => {
21680 return new Promise((resolve, reject) => {
21681 const performCall = /* @__PURE__ */ (0,chunk_YTJNT7DU/* __name */.eW)(() => new Promise((res, rej) => {
21682 mermaidAPI.render(id27, text, container).then(
21683 (r) => {
21684 res(r);
21685 resolve(r);
21686 },
21687 (e) => {
21688 chunk_YTJNT7DU/* log */.cM.error("Error parsing", e);
21689 mermaid.parseError?.(e);
21690 rej(e);
21691 reject(e);
21692 }
21693 );
21694 }), "performCall");
21695 executionQueue.push(performCall);
21696 executeQueue().catch(reject);
21697 });
21698 }, "render");
21699 var mermaid = {
21700 startOnLoad: true,
21701 mermaidAPI,
21702 parse: parse2,
21703 render: render2,
21704 init,
21705 run,
21706 registerExternalDiagrams,
21707 registerLayoutLoaders: chunk_TYCBKAJE/* registerLayoutLoaders */.jM,
21708 initialize: initialize2,
21709 parseError: void 0,
21710 contentLoaded,
21711 setParseErrorHandler,
21712 detectType: chunk_YTJNT7DU/* detectType */.Vg,
21713 registerIconPacks: chunk_H2D2JQ3I/* registerIconPacks */.ef
21714 };
21715 var mermaid_default = mermaid;
21716
21717 /*! Check if previously processed */
21718 /*!
21719 * Wait for document loaded before starting the execution
21720 */
21721
21722
21723 /***/ }),
21724
21725 /***/ 36366:
21726 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
21727
21728 "use strict";
21729 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
21730 /* harmony export */ Z: () => (/* binding */ at)
21731 /* harmony export */ });
21732 function t(t,e,s){if(t&&t.length){const[n,o]=e,a=Math.PI/180*s,h=Math.cos(a),r=Math.sin(a);for(const e of t){const[t,s]=e;e[0]=(t-n)*h-(s-o)*r+n,e[1]=(t-n)*r+(s-o)*h+o}}}function e(t,e){return t[0]===e[0]&&t[1]===e[1]}function s(s,n,o,a=1){const h=o,r=Math.max(n,.1),i=s[0]&&s[0][0]&&"number"==typeof s[0][0]?[s]:s,c=[0,0];if(h)for(const e of i)t(e,c,h);const l=function(t,s,n){const o=[];for(const s of t){const t=[...s];e(t[0],t[t.length-1])||t.push([t[0][0],t[0][1]]),t.length>2&&o.push(t)}const a=[];s=Math.max(s,.1);const h=[];for(const t of o)for(let e=0;e<t.length-1;e++){const s=t[e],n=t[e+1];if(s[1]!==n[1]){const t=Math.min(s[1],n[1]);h.push({ymin:t,ymax:Math.max(s[1],n[1]),x:t===s[1]?s[0]:n[0],islope:(n[0]-s[0])/(n[1]-s[1])})}}if(h.sort(((t,e)=>t.ymin<e.ymin?-1:t.ymin>e.ymin?1:t.x<e.x?-1:t.x>e.x?1:t.ymax===e.ymax?0:(t.ymax-e.ymax)/Math.abs(t.ymax-e.ymax))),!h.length)return a;let r=[],i=h[0].ymin,c=0;for(;r.length||h.length;){if(h.length){let t=-1;for(let e=0;e<h.length&&!(h[e].ymin>i);e++)t=e;h.splice(0,t+1).forEach((t=>{r.push({s:i,edge:t})}))}if(r=r.filter((t=>!(t.edge.ymax<=i))),r.sort(((t,e)=>t.edge.x===e.edge.x?0:(t.edge.x-e.edge.x)/Math.abs(t.edge.x-e.edge.x))),(1!==n||c%s==0)&&r.length>1)for(let t=0;t<r.length;t+=2){const e=t+1;if(e>=r.length)break;const s=r[t].edge,n=r[e].edge;a.push([[Math.round(s.x),i],[Math.round(n.x),i]])}i+=n,r.forEach((t=>{t.edge.x=t.edge.x+n*t.edge.islope})),c++}return a}(i,r,a);if(h){for(const e of i)t(e,c,-h);!function(e,s,n){const o=[];e.forEach((t=>o.push(...t))),t(o,s,n)}(l,c,-h)}return l}function n(t,e){var n;const o=e.hachureAngle+90;let a=e.hachureGap;a<0&&(a=4*e.strokeWidth),a=Math.round(Math.max(a,.1));let h=1;return e.roughness>=1&&((null===(n=e.randomizer)||void 0===n?void 0:n.next())||Math.random())>.7&&(h=a),s(t,a,o,h||1)}class o{constructor(t){this.helper=t}fillPolygons(t,e){return this._fillPolygons(t,e)}_fillPolygons(t,e){const s=n(t,e);return{type:"fillSketch",ops:this.renderLines(s,e)}}renderLines(t,e){const s=[];for(const n of t)s.push(...this.helper.doubleLineOps(n[0][0],n[0][1],n[1][0],n[1][1],e));return s}}function a(t){const e=t[0],s=t[1];return Math.sqrt(Math.pow(e[0]-s[0],2)+Math.pow(e[1]-s[1],2))}class h extends o{fillPolygons(t,e){let s=e.hachureGap;s<0&&(s=4*e.strokeWidth),s=Math.max(s,.1);const o=n(t,Object.assign({},e,{hachureGap:s})),h=Math.PI/180*e.hachureAngle,r=[],i=.5*s*Math.cos(h),c=.5*s*Math.sin(h);for(const[t,e]of o)a([t,e])&&r.push([[t[0]-i,t[1]+c],[...e]],[[t[0]+i,t[1]-c],[...e]]);return{type:"fillSketch",ops:this.renderLines(r,e)}}}class r extends o{fillPolygons(t,e){const s=this._fillPolygons(t,e),n=Object.assign({},e,{hachureAngle:e.hachureAngle+90}),o=this._fillPolygons(t,n);return s.ops=s.ops.concat(o.ops),s}}class i{constructor(t){this.helper=t}fillPolygons(t,e){const s=n(t,e=Object.assign({},e,{hachureAngle:0}));return this.dotsOnLines(s,e)}dotsOnLines(t,e){const s=[];let n=e.hachureGap;n<0&&(n=4*e.strokeWidth),n=Math.max(n,.1);let o=e.fillWeight;o<0&&(o=e.strokeWidth/2);const h=n/4;for(const r of t){const t=a(r),i=t/n,c=Math.ceil(i)-1,l=t-c*n,u=(r[0][0]+r[1][0])/2-n/4,p=Math.min(r[0][1],r[1][1]);for(let t=0;t<c;t++){const a=p+l+t*n,r=u-h+2*Math.random()*h,i=a-h+2*Math.random()*h,c=this.helper.ellipse(r,i,o,o,e);s.push(...c.ops)}}return{type:"fillSketch",ops:s}}}class c{constructor(t){this.helper=t}fillPolygons(t,e){const s=n(t,e);return{type:"fillSketch",ops:this.dashedLine(s,e)}}dashedLine(t,e){const s=e.dashOffset<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashOffset,n=e.dashGap<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashGap,o=[];return t.forEach((t=>{const h=a(t),r=Math.floor(h/(s+n)),i=(h+n-r*(s+n))/2;let c=t[0],l=t[1];c[0]>l[0]&&(c=t[1],l=t[0]);const u=Math.atan((l[1]-c[1])/(l[0]-c[0]));for(let t=0;t<r;t++){const a=t*(s+n),h=a+s,r=[c[0]+a*Math.cos(u)+i*Math.cos(u),c[1]+a*Math.sin(u)+i*Math.sin(u)],l=[c[0]+h*Math.cos(u)+i*Math.cos(u),c[1]+h*Math.sin(u)+i*Math.sin(u)];o.push(...this.helper.doubleLineOps(r[0],r[1],l[0],l[1],e))}})),o}}class l{constructor(t){this.helper=t}fillPolygons(t,e){const s=e.hachureGap<0?4*e.strokeWidth:e.hachureGap,o=e.zigzagOffset<0?s:e.zigzagOffset,a=n(t,e=Object.assign({},e,{hachureGap:s+o}));return{type:"fillSketch",ops:this.zigzagLines(a,o,e)}}zigzagLines(t,e,s){const n=[];return t.forEach((t=>{const o=a(t),h=Math.round(o/(2*e));let r=t[0],i=t[1];r[0]>i[0]&&(r=t[1],i=t[0]);const c=Math.atan((i[1]-r[1])/(i[0]-r[0]));for(let t=0;t<h;t++){const o=2*t*e,a=2*(t+1)*e,h=Math.sqrt(2*Math.pow(e,2)),i=[r[0]+o*Math.cos(c),r[1]+o*Math.sin(c)],l=[r[0]+a*Math.cos(c),r[1]+a*Math.sin(c)],u=[i[0]+h*Math.cos(c+Math.PI/4),i[1]+h*Math.sin(c+Math.PI/4)];n.push(...this.helper.doubleLineOps(i[0],i[1],u[0],u[1],s),...this.helper.doubleLineOps(u[0],u[1],l[0],l[1],s))}})),n}}const u={};class p{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const f=0,d=1,g=2,M={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function k(t,e){return t.type===e}function b(t){const e=[],s=function(t){const e=new Array;for(;""!==t;)if(t.match(/^([ \t\r\n,]+)/))t=t.substr(RegExp.$1.length);else if(t.match(/^([aAcChHlLmMqQsStTvVzZ])/))e[e.length]={type:f,text:RegExp.$1},t=t.substr(RegExp.$1.length);else{if(!t.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];e[e.length]={type:d,text:`${parseFloat(RegExp.$1)}`},t=t.substr(RegExp.$1.length)}return e[e.length]={type:g,text:""},e}(t);let n="BOD",o=0,a=s[o];for(;!k(a,g);){let h=0;const r=[];if("BOD"===n){if("M"!==a.text&&"m"!==a.text)return b("M0,0"+t);o++,h=M[a.text],n=a.text}else k(a,d)?h=M[n]:(o++,h=M[a.text],n=a.text);if(!(o+h<s.length))throw new Error("Path data ended short");for(let t=o;t<o+h;t++){const e=s[t];if(!k(e,d))throw new Error("Param not a number: "+n+","+e.text);r[r.length]=+e.text}if("number"!=typeof M[n])throw new Error("Bad segment: "+n);{const t={key:n,data:r};e.push(t),o+=h,a=s[o],"M"===n&&(n="L"),"m"===n&&(n="l")}}return e}function y(t){let e=0,s=0,n=0,o=0;const a=[];for(const{key:h,data:r}of t)switch(h){case"M":a.push({key:"M",data:[...r]}),[e,s]=r,[n,o]=r;break;case"m":e+=r[0],s+=r[1],a.push({key:"M",data:[e,s]}),n=e,o=s;break;case"L":a.push({key:"L",data:[...r]}),[e,s]=r;break;case"l":e+=r[0],s+=r[1],a.push({key:"L",data:[e,s]});break;case"C":a.push({key:"C",data:[...r]}),e=r[4],s=r[5];break;case"c":{const t=r.map(((t,n)=>n%2?t+s:t+e));a.push({key:"C",data:t}),e=t[4],s=t[5];break}case"Q":a.push({key:"Q",data:[...r]}),e=r[2],s=r[3];break;case"q":{const t=r.map(((t,n)=>n%2?t+s:t+e));a.push({key:"Q",data:t}),e=t[2],s=t[3];break}case"A":a.push({key:"A",data:[...r]}),e=r[5],s=r[6];break;case"a":e+=r[5],s+=r[6],a.push({key:"A",data:[r[0],r[1],r[2],r[3],r[4],e,s]});break;case"H":a.push({key:"H",data:[...r]}),e=r[0];break;case"h":e+=r[0],a.push({key:"H",data:[e]});break;case"V":a.push({key:"V",data:[...r]}),s=r[0];break;case"v":s+=r[0],a.push({key:"V",data:[s]});break;case"S":a.push({key:"S",data:[...r]}),e=r[2],s=r[3];break;case"s":{const t=r.map(((t,n)=>n%2?t+s:t+e));a.push({key:"S",data:t}),e=t[2],s=t[3];break}case"T":a.push({key:"T",data:[...r]}),e=r[0],s=r[1];break;case"t":e+=r[0],s+=r[1],a.push({key:"T",data:[e,s]});break;case"Z":case"z":a.push({key:"Z",data:[]}),e=n,s=o}return a}function m(t){const e=[];let s="",n=0,o=0,a=0,h=0,r=0,i=0;for(const{key:c,data:l}of t){switch(c){case"M":e.push({key:"M",data:[...l]}),[n,o]=l,[a,h]=l;break;case"C":e.push({key:"C",data:[...l]}),n=l[4],o=l[5],r=l[2],i=l[3];break;case"L":e.push({key:"L",data:[...l]}),[n,o]=l;break;case"H":n=l[0],e.push({key:"L",data:[n,o]});break;case"V":o=l[0],e.push({key:"L",data:[n,o]});break;case"S":{let t=0,a=0;"C"===s||"S"===s?(t=n+(n-r),a=o+(o-i)):(t=n,a=o),e.push({key:"C",data:[t,a,...l]}),r=l[0],i=l[1],n=l[2],o=l[3];break}case"T":{const[t,a]=l;let h=0,c=0;"Q"===s||"T"===s?(h=n+(n-r),c=o+(o-i)):(h=n,c=o);const u=n+2*(h-n)/3,p=o+2*(c-o)/3,f=t+2*(h-t)/3,d=a+2*(c-a)/3;e.push({key:"C",data:[u,p,f,d,t,a]}),r=h,i=c,n=t,o=a;break}case"Q":{const[t,s,a,h]=l,c=n+2*(t-n)/3,u=o+2*(s-o)/3,p=a+2*(t-a)/3,f=h+2*(s-h)/3;e.push({key:"C",data:[c,u,p,f,a,h]}),r=t,i=s,n=a,o=h;break}case"A":{const t=Math.abs(l[0]),s=Math.abs(l[1]),a=l[2],h=l[3],r=l[4],i=l[5],c=l[6];if(0===t||0===s)e.push({key:"C",data:[n,o,i,c,i,c]}),n=i,o=c;else if(n!==i||o!==c){x(n,o,i,c,t,s,a,h,r).forEach((function(t){e.push({key:"C",data:t})})),n=i,o=c}break}case"Z":e.push({key:"Z",data:[]}),n=a,o=h}s=c}return e}function w(t,e,s){return[t*Math.cos(s)-e*Math.sin(s),t*Math.sin(s)+e*Math.cos(s)]}function x(t,e,s,n,o,a,h,r,i,c){const l=(u=h,Math.PI*u/180);var u;let p=[],f=0,d=0,g=0,M=0;if(c)[f,d,g,M]=c;else{[t,e]=w(t,e,-l),[s,n]=w(s,n,-l);const h=(t-s)/2,c=(e-n)/2;let u=h*h/(o*o)+c*c/(a*a);u>1&&(u=Math.sqrt(u),o*=u,a*=u);const p=o*o,k=a*a,b=p*k-p*c*c-k*h*h,y=p*c*c+k*h*h,m=(r===i?-1:1)*Math.sqrt(Math.abs(b/y));g=m*o*c/a+(t+s)/2,M=m*-a*h/o+(e+n)/2,f=Math.asin(parseFloat(((e-M)/a).toFixed(9))),d=Math.asin(parseFloat(((n-M)/a).toFixed(9))),t<g&&(f=Math.PI-f),s<g&&(d=Math.PI-d),f<0&&(f=2*Math.PI+f),d<0&&(d=2*Math.PI+d),i&&f>d&&(f-=2*Math.PI),!i&&d>f&&(d-=2*Math.PI)}let k=d-f;if(Math.abs(k)>120*Math.PI/180){const t=d,e=s,r=n;d=i&&d>f?f+120*Math.PI/180*1:f+120*Math.PI/180*-1,p=x(s=g+o*Math.cos(d),n=M+a*Math.sin(d),e,r,o,a,h,0,i,[d,t,g,M])}k=d-f;const b=Math.cos(f),y=Math.sin(f),m=Math.cos(d),P=Math.sin(d),v=Math.tan(k/4),S=4/3*o*v,O=4/3*a*v,L=[t,e],T=[t+S*y,e-O*b],D=[s+S*P,n-O*m],A=[s,n];if(T[0]=2*L[0]-T[0],T[1]=2*L[1]-T[1],c)return[T,D,A].concat(p);{p=[T,D,A].concat(p);const t=[];for(let e=0;e<p.length;e+=3){const s=w(p[e][0],p[e][1],l),n=w(p[e+1][0],p[e+1][1],l),o=w(p[e+2][0],p[e+2][1],l);t.push([s[0],s[1],n[0],n[1],o[0],o[1]])}return t}}const P={randOffset:function(t,e){return G(t,e)},randOffsetWithRange:function(t,e,s){return E(t,e,s)},ellipse:function(t,e,s,n,o){const a=T(s,n,o);return D(t,e,o,a).opset},doubleLineOps:function(t,e,s,n,o){return $(t,e,s,n,o,!0)}};function v(t,e,s,n,o){return{type:"path",ops:$(t,e,s,n,o)}}function S(t,e,s){const n=(t||[]).length;if(n>2){const o=[];for(let e=0;e<n-1;e++)o.push(...$(t[e][0],t[e][1],t[e+1][0],t[e+1][1],s));return e&&o.push(...$(t[n-1][0],t[n-1][1],t[0][0],t[0][1],s)),{type:"path",ops:o}}return 2===n?v(t[0][0],t[0][1],t[1][0],t[1][1],s):{type:"path",ops:[]}}function O(t,e,s,n,o){return function(t,e){return S(t,!0,e)}([[t,e],[t+s,e],[t+s,e+n],[t,e+n]],o)}function L(t,e){if(t.length){const s="number"==typeof t[0][0]?[t]:t,n=j(s[0],1*(1+.2*e.roughness),e),o=e.disableMultiStroke?[]:j(s[0],1.5*(1+.22*e.roughness),z(e));for(let t=1;t<s.length;t++){const a=s[t];if(a.length){const t=j(a,1*(1+.2*e.roughness),e),s=e.disableMultiStroke?[]:j(a,1.5*(1+.22*e.roughness),z(e));for(const e of t)"move"!==e.op&&n.push(e);for(const t of s)"move"!==t.op&&o.push(t)}}return{type:"path",ops:n.concat(o)}}return{type:"path",ops:[]}}function T(t,e,s){const n=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(t/2,2)+Math.pow(e/2,2))/2)),o=Math.ceil(Math.max(s.curveStepCount,s.curveStepCount/Math.sqrt(200)*n)),a=2*Math.PI/o;let h=Math.abs(t/2),r=Math.abs(e/2);const i=1-s.curveFitting;return h+=G(h*i,s),r+=G(r*i,s),{increment:a,rx:h,ry:r}}function D(t,e,s,n){const[o,a]=F(n.increment,t,e,n.rx,n.ry,1,n.increment*E(.1,E(.4,1,s),s),s);let h=q(o,null,s);if(!s.disableMultiStroke&&0!==s.roughness){const[o]=F(n.increment,t,e,n.rx,n.ry,1.5,0,s),a=q(o,null,s);h=h.concat(a)}return{estimatedPoints:a,opset:{type:"path",ops:h}}}function A(t,e,s,n,o,a,h,r,i){const c=t,l=e;let u=Math.abs(s/2),p=Math.abs(n/2);u+=G(.01*u,i),p+=G(.01*p,i);let f=o,d=a;for(;f<0;)f+=2*Math.PI,d+=2*Math.PI;d-f>2*Math.PI&&(f=0,d=2*Math.PI);const g=2*Math.PI/i.curveStepCount,M=Math.min(g/2,(d-f)/2),k=V(M,c,l,u,p,f,d,1,i);if(!i.disableMultiStroke){const t=V(M,c,l,u,p,f,d,1.5,i);k.push(...t)}return h&&(r?k.push(...$(c,l,c+u*Math.cos(f),l+p*Math.sin(f),i),...$(c,l,c+u*Math.cos(d),l+p*Math.sin(d),i)):k.push({op:"lineTo",data:[c,l]},{op:"lineTo",data:[c+u*Math.cos(f),l+p*Math.sin(f)]})),{type:"path",ops:k}}function _(t,e){const s=m(y(b(t))),n=[];let o=[0,0],a=[0,0];for(const{key:t,data:h}of s)switch(t){case"M":a=[h[0],h[1]],o=[h[0],h[1]];break;case"L":n.push(...$(a[0],a[1],h[0],h[1],e)),a=[h[0],h[1]];break;case"C":{const[t,s,o,r,i,c]=h;n.push(...Z(t,s,o,r,i,c,a,e)),a=[i,c];break}case"Z":n.push(...$(a[0],a[1],o[0],o[1],e)),a=[o[0],o[1]]}return{type:"path",ops:n}}function I(t,e){const s=[];for(const n of t)if(n.length){const t=e.maxRandomnessOffset||0,o=n.length;if(o>2){s.push({op:"move",data:[n[0][0]+G(t,e),n[0][1]+G(t,e)]});for(let a=1;a<o;a++)s.push({op:"lineTo",data:[n[a][0]+G(t,e),n[a][1]+G(t,e)]})}}return{type:"fillPath",ops:s}}function C(t,e){return function(t,e){let s=t.fillStyle||"hachure";if(!u[s])switch(s){case"zigzag":u[s]||(u[s]=new h(e));break;case"cross-hatch":u[s]||(u[s]=new r(e));break;case"dots":u[s]||(u[s]=new i(e));break;case"dashed":u[s]||(u[s]=new c(e));break;case"zigzag-line":u[s]||(u[s]=new l(e));break;default:s="hachure",u[s]||(u[s]=new o(e))}return u[s]}(e,P).fillPolygons(t,e)}function z(t){const e=Object.assign({},t);return e.randomizer=void 0,t.seed&&(e.seed=t.seed+1),e}function W(t){return t.randomizer||(t.randomizer=new p(t.seed||0)),t.randomizer.next()}function E(t,e,s,n=1){return s.roughness*n*(W(s)*(e-t)+t)}function G(t,e,s=1){return E(-t,t,e,s)}function $(t,e,s,n,o,a=!1){const h=a?o.disableMultiStrokeFill:o.disableMultiStroke,r=R(t,e,s,n,o,!0,!1);if(h)return r;const i=R(t,e,s,n,o,!0,!0);return r.concat(i)}function R(t,e,s,n,o,a,h){const r=Math.pow(t-s,2)+Math.pow(e-n,2),i=Math.sqrt(r);let c=1;c=i<200?1:i>500?.4:-.0016668*i+1.233334;let l=o.maxRandomnessOffset||0;l*l*100>r&&(l=i/10);const u=l/2,p=.2+.2*W(o);let f=o.bowing*o.maxRandomnessOffset*(n-e)/200,d=o.bowing*o.maxRandomnessOffset*(t-s)/200;f=G(f,o,c),d=G(d,o,c);const g=[],M=()=>G(u,o,c),k=()=>G(l,o,c),b=o.preserveVertices;return a&&(h?g.push({op:"move",data:[t+(b?0:M()),e+(b?0:M())]}):g.push({op:"move",data:[t+(b?0:G(l,o,c)),e+(b?0:G(l,o,c))]})),h?g.push({op:"bcurveTo",data:[f+t+(s-t)*p+M(),d+e+(n-e)*p+M(),f+t+2*(s-t)*p+M(),d+e+2*(n-e)*p+M(),s+(b?0:M()),n+(b?0:M())]}):g.push({op:"bcurveTo",data:[f+t+(s-t)*p+k(),d+e+(n-e)*p+k(),f+t+2*(s-t)*p+k(),d+e+2*(n-e)*p+k(),s+(b?0:k()),n+(b?0:k())]}),g}function j(t,e,s){if(!t.length)return[];const n=[];n.push([t[0][0]+G(e,s),t[0][1]+G(e,s)]),n.push([t[0][0]+G(e,s),t[0][1]+G(e,s)]);for(let o=1;o<t.length;o++)n.push([t[o][0]+G(e,s),t[o][1]+G(e,s)]),o===t.length-1&&n.push([t[o][0]+G(e,s),t[o][1]+G(e,s)]);return q(n,null,s)}function q(t,e,s){const n=t.length,o=[];if(n>3){const a=[],h=1-s.curveTightness;o.push({op:"move",data:[t[1][0],t[1][1]]});for(let e=1;e+2<n;e++){const s=t[e];a[0]=[s[0],s[1]],a[1]=[s[0]+(h*t[e+1][0]-h*t[e-1][0])/6,s[1]+(h*t[e+1][1]-h*t[e-1][1])/6],a[2]=[t[e+1][0]+(h*t[e][0]-h*t[e+2][0])/6,t[e+1][1]+(h*t[e][1]-h*t[e+2][1])/6],a[3]=[t[e+1][0],t[e+1][1]],o.push({op:"bcurveTo",data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}if(e&&2===e.length){const t=s.maxRandomnessOffset;o.push({op:"lineTo",data:[e[0]+G(t,s),e[1]+G(t,s)]})}}else 3===n?(o.push({op:"move",data:[t[1][0],t[1][1]]}),o.push({op:"bcurveTo",data:[t[1][0],t[1][1],t[2][0],t[2][1],t[2][0],t[2][1]]})):2===n&&o.push(...R(t[0][0],t[0][1],t[1][0],t[1][1],s,!0,!0));return o}function F(t,e,s,n,o,a,h,r){const i=[],c=[];if(0===r.roughness){t/=4,c.push([e+n*Math.cos(-t),s+o*Math.sin(-t)]);for(let a=0;a<=2*Math.PI;a+=t){const t=[e+n*Math.cos(a),s+o*Math.sin(a)];i.push(t),c.push(t)}c.push([e+n*Math.cos(0),s+o*Math.sin(0)]),c.push([e+n*Math.cos(t),s+o*Math.sin(t)])}else{const l=G(.5,r)-Math.PI/2;c.push([G(a,r)+e+.9*n*Math.cos(l-t),G(a,r)+s+.9*o*Math.sin(l-t)]);const u=2*Math.PI+l-.01;for(let h=l;h<u;h+=t){const t=[G(a,r)+e+n*Math.cos(h),G(a,r)+s+o*Math.sin(h)];i.push(t),c.push(t)}c.push([G(a,r)+e+n*Math.cos(l+2*Math.PI+.5*h),G(a,r)+s+o*Math.sin(l+2*Math.PI+.5*h)]),c.push([G(a,r)+e+.98*n*Math.cos(l+h),G(a,r)+s+.98*o*Math.sin(l+h)]),c.push([G(a,r)+e+.9*n*Math.cos(l+.5*h),G(a,r)+s+.9*o*Math.sin(l+.5*h)])}return[c,i]}function V(t,e,s,n,o,a,h,r,i){const c=a+G(.1,i),l=[];l.push([G(r,i)+e+.9*n*Math.cos(c-t),G(r,i)+s+.9*o*Math.sin(c-t)]);for(let a=c;a<=h;a+=t)l.push([G(r,i)+e+n*Math.cos(a),G(r,i)+s+o*Math.sin(a)]);return l.push([e+n*Math.cos(h),s+o*Math.sin(h)]),l.push([e+n*Math.cos(h),s+o*Math.sin(h)]),q(l,null,i)}function Z(t,e,s,n,o,a,h,r){const i=[],c=[r.maxRandomnessOffset||1,(r.maxRandomnessOffset||1)+.3];let l=[0,0];const u=r.disableMultiStroke?1:2,p=r.preserveVertices;for(let f=0;f<u;f++)0===f?i.push({op:"move",data:[h[0],h[1]]}):i.push({op:"move",data:[h[0]+(p?0:G(c[0],r)),h[1]+(p?0:G(c[0],r))]}),l=p?[o,a]:[o+G(c[f],r),a+G(c[f],r)],i.push({op:"bcurveTo",data:[t+G(c[f],r),e+G(c[f],r),s+G(c[f],r),n+G(c[f],r),l[0],l[1]]});return i}function Q(t){return[...t]}function H(t,e=0){const s=t.length;if(s<3)throw new Error("A curve must have at least three points.");const n=[];if(3===s)n.push(Q(t[0]),Q(t[1]),Q(t[2]),Q(t[2]));else{const s=[];s.push(t[0],t[0]);for(let e=1;e<t.length;e++)s.push(t[e]),e===t.length-1&&s.push(t[e]);const o=[],a=1-e;n.push(Q(s[0]));for(let t=1;t+2<s.length;t++){const e=s[t];o[0]=[e[0],e[1]],o[1]=[e[0]+(a*s[t+1][0]-a*s[t-1][0])/6,e[1]+(a*s[t+1][1]-a*s[t-1][1])/6],o[2]=[s[t+1][0]+(a*s[t][0]-a*s[t+2][0])/6,s[t+1][1]+(a*s[t][1]-a*s[t+2][1])/6],o[3]=[s[t+1][0],s[t+1][1]],n.push(o[1],o[2],o[3])}}return n}function N(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)}function B(t,e,s){const n=N(e,s);if(0===n)return N(t,e);let o=((t[0]-e[0])*(s[0]-e[0])+(t[1]-e[1])*(s[1]-e[1]))/n;return o=Math.max(0,Math.min(1,o)),N(t,J(e,s,o))}function J(t,e,s){return[t[0]+(e[0]-t[0])*s,t[1]+(e[1]-t[1])*s]}function K(t,e,s,n){const o=n||[];if(function(t,e){const s=t[e+0],n=t[e+1],o=t[e+2],a=t[e+3];let h=3*n[0]-2*s[0]-a[0];h*=h;let r=3*n[1]-2*s[1]-a[1];r*=r;let i=3*o[0]-2*a[0]-s[0];i*=i;let c=3*o[1]-2*a[1]-s[1];return c*=c,h<i&&(h=i),r<c&&(r=c),h+r}(t,e)<s){const s=t[e+0];if(o.length){(a=o[o.length-1],h=s,Math.sqrt(N(a,h)))>1&&o.push(s)}else o.push(s);o.push(t[e+3])}else{const n=.5,a=t[e+0],h=t[e+1],r=t[e+2],i=t[e+3],c=J(a,h,n),l=J(h,r,n),u=J(r,i,n),p=J(c,l,n),f=J(l,u,n),d=J(p,f,n);K([a,c,p,d],0,s,o),K([d,f,u,i],0,s,o)}var a,h;return o}function U(t,e){return X(t,0,t.length,e)}function X(t,e,s,n,o){const a=o||[],h=t[e],r=t[s-1];let i=0,c=1;for(let n=e+1;n<s-1;++n){const e=B(t[n],h,r);e>i&&(i=e,c=n)}return Math.sqrt(i)>n?(X(t,e,c+1,n,a),X(t,c,s,n,a)):(a.length||a.push(h),a.push(r)),a}function Y(t,e=.15,s){const n=[],o=(t.length-1)/3;for(let s=0;s<o;s++){K(t,3*s,e,n)}return s&&s>0?X(n,0,n.length,s):n}const tt="none";class et{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,e,s){return{shape:t,sets:e||[],options:s||this.defaultOptions}}line(t,e,s,n,o){const a=this._o(o);return this._d("line",[v(t,e,s,n,a)],a)}rectangle(t,e,s,n,o){const a=this._o(o),h=[],r=O(t,e,s,n,a);if(a.fill){const o=[[t,e],[t+s,e],[t+s,e+n],[t,e+n]];"solid"===a.fillStyle?h.push(I([o],a)):h.push(C([o],a))}return a.stroke!==tt&&h.push(r),this._d("rectangle",h,a)}ellipse(t,e,s,n,o){const a=this._o(o),h=[],r=T(s,n,a),i=D(t,e,a,r);if(a.fill)if("solid"===a.fillStyle){const s=D(t,e,a,r).opset;s.type="fillPath",h.push(s)}else h.push(C([i.estimatedPoints],a));return a.stroke!==tt&&h.push(i.opset),this._d("ellipse",h,a)}circle(t,e,s,n){const o=this.ellipse(t,e,s,s,n);return o.shape="circle",o}linearPath(t,e){const s=this._o(e);return this._d("linearPath",[S(t,!1,s)],s)}arc(t,e,s,n,o,a,h=!1,r){const i=this._o(r),c=[],l=A(t,e,s,n,o,a,h,!0,i);if(h&&i.fill)if("solid"===i.fillStyle){const h=Object.assign({},i);h.disableMultiStroke=!0;const r=A(t,e,s,n,o,a,!0,!1,h);r.type="fillPath",c.push(r)}else c.push(function(t,e,s,n,o,a,h){const r=t,i=e;let c=Math.abs(s/2),l=Math.abs(n/2);c+=G(.01*c,h),l+=G(.01*l,h);let u=o,p=a;for(;u<0;)u+=2*Math.PI,p+=2*Math.PI;p-u>2*Math.PI&&(u=0,p=2*Math.PI);const f=(p-u)/h.curveStepCount,d=[];for(let t=u;t<=p;t+=f)d.push([r+c*Math.cos(t),i+l*Math.sin(t)]);return d.push([r+c*Math.cos(p),i+l*Math.sin(p)]),d.push([r,i]),C([d],h)}(t,e,s,n,o,a,i));return i.stroke!==tt&&c.push(l),this._d("arc",c,i)}curve(t,e){const s=this._o(e),n=[],o=L(t,s);if(s.fill&&s.fill!==tt)if("solid"===s.fillStyle){const e=L(t,Object.assign(Object.assign({},s),{disableMultiStroke:!0,roughness:s.roughness?s.roughness+s.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(e.ops)})}else{const e=[],o=t;if(o.length){const t="number"==typeof o[0][0]?[o]:o;for(const n of t)n.length<3?e.push(...n):3===n.length?e.push(...Y(H([n[0],n[0],n[1],n[2]]),10,(1+s.roughness)/2)):e.push(...Y(H(n),10,(1+s.roughness)/2))}e.length&&n.push(C([e],s))}return s.stroke!==tt&&n.push(o),this._d("curve",n,s)}polygon(t,e){const s=this._o(e),n=[],o=S(t,!0,s);return s.fill&&("solid"===s.fillStyle?n.push(I([t],s)):n.push(C([t],s))),s.stroke!==tt&&n.push(o),this._d("polygon",n,s)}path(t,e){const s=this._o(e),n=[];if(!t)return this._d("path",n,s);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const o=s.fill&&"transparent"!==s.fill&&s.fill!==tt,a=s.stroke!==tt,h=!!(s.simplification&&s.simplification<1),r=function(t,e,s){const n=m(y(b(t))),o=[];let a=[],h=[0,0],r=[];const i=()=>{r.length>=4&&a.push(...Y(r,e)),r=[]},c=()=>{i(),a.length&&(o.push(a),a=[])};for(const{key:t,data:e}of n)switch(t){case"M":c(),h=[e[0],e[1]],a.push(h);break;case"L":i(),a.push([e[0],e[1]]);break;case"C":if(!r.length){const t=a.length?a[a.length-1]:h;r.push([t[0],t[1]])}r.push([e[0],e[1]]),r.push([e[2],e[3]]),r.push([e[4],e[5]]);break;case"Z":i(),a.push([h[0],h[1]])}if(c(),!s)return o;const l=[];for(const t of o){const e=U(t,s);e.length&&l.push(e)}return l}(t,1,h?4-4*(s.simplification||1):(1+s.roughness)/2),i=_(t,s);if(o)if("solid"===s.fillStyle)if(1===r.length){const e=_(t,Object.assign(Object.assign({},s),{disableMultiStroke:!0,roughness:s.roughness?s.roughness+s.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(e.ops)})}else n.push(I(r,s));else n.push(C(r,s));return a&&(h?r.forEach((t=>{n.push(S(t,!1,s))})):n.push(i)),this._d("path",n,s)}opsToPath(t,e){let s="";for(const n of t.ops){const t="number"==typeof e&&e>=0?n.data.map((t=>+t.toFixed(e))):n.data;switch(n.op){case"move":s+=`M${t[0]} ${t[1]} `;break;case"bcurveTo":s+=`C${t[0]} ${t[1]}, ${t[2]} ${t[3]}, ${t[4]} ${t[5]} `;break;case"lineTo":s+=`L${t[0]} ${t[1]} `}}return s.trim()}toPaths(t){const e=t.sets||[],s=t.options||this.defaultOptions,n=[];for(const t of e){let e=null;switch(t.type){case"path":e={d:this.opsToPath(t),stroke:s.stroke,strokeWidth:s.strokeWidth,fill:tt};break;case"fillPath":e={d:this.opsToPath(t),stroke:tt,strokeWidth:0,fill:s.fill||tt};break;case"fillSketch":e=this.fillSketch(t,s)}e&&n.push(e)}return n}fillSketch(t,e){let s=e.fillWeight;return s<0&&(s=e.strokeWidth/2),{d:this.opsToPath(t),stroke:e.fill||tt,strokeWidth:s,fill:tt}}_mergedShape(t){return t.filter(((t,e)=>0===e||"move"!==t.op))}}class st{constructor(t,e){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new et(e)}draw(t){const e=t.sets||[],s=t.options||this.getDefaultOptions(),n=this.ctx,o=t.options.fixedDecimalPlaceDigits;for(const a of e)switch(a.type){case"path":n.save(),n.strokeStyle="none"===s.stroke?"transparent":s.stroke,n.lineWidth=s.strokeWidth,s.strokeLineDash&&n.setLineDash(s.strokeLineDash),s.strokeLineDashOffset&&(n.lineDashOffset=s.strokeLineDashOffset),this._drawToContext(n,a,o),n.restore();break;case"fillPath":{n.save(),n.fillStyle=s.fill||"";const e="curve"===t.shape||"polygon"===t.shape||"path"===t.shape?"evenodd":"nonzero";this._drawToContext(n,a,o,e),n.restore();break}case"fillSketch":this.fillSketch(n,a,s)}}fillSketch(t,e,s){let n=s.fillWeight;n<0&&(n=s.strokeWidth/2),t.save(),s.fillLineDash&&t.setLineDash(s.fillLineDash),s.fillLineDashOffset&&(t.lineDashOffset=s.fillLineDashOffset),t.strokeStyle=s.fill||"",t.lineWidth=n,this._drawToContext(t,e,s.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,e,s,n="nonzero"){t.beginPath();for(const n of e.ops){const e="number"==typeof s&&s>=0?n.data.map((t=>+t.toFixed(s))):n.data;switch(n.op){case"move":t.moveTo(e[0],e[1]);break;case"bcurveTo":t.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]);break;case"lineTo":t.lineTo(e[0],e[1])}}"fillPath"===e.type?t.fill(n):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,e,s,n,o){const a=this.gen.line(t,e,s,n,o);return this.draw(a),a}rectangle(t,e,s,n,o){const a=this.gen.rectangle(t,e,s,n,o);return this.draw(a),a}ellipse(t,e,s,n,o){const a=this.gen.ellipse(t,e,s,n,o);return this.draw(a),a}circle(t,e,s,n){const o=this.gen.circle(t,e,s,n);return this.draw(o),o}linearPath(t,e){const s=this.gen.linearPath(t,e);return this.draw(s),s}polygon(t,e){const s=this.gen.polygon(t,e);return this.draw(s),s}arc(t,e,s,n,o,a,h=!1,r){const i=this.gen.arc(t,e,s,n,o,a,h,r);return this.draw(i),i}curve(t,e){const s=this.gen.curve(t,e);return this.draw(s),s}path(t,e){const s=this.gen.path(t,e);return this.draw(s),s}}const nt="http://www.w3.org/2000/svg";class ot{constructor(t,e){this.svg=t,this.gen=new et(e)}draw(t){const e=t.sets||[],s=t.options||this.getDefaultOptions(),n=this.svg.ownerDocument||window.document,o=n.createElementNS(nt,"g"),a=t.options.fixedDecimalPlaceDigits;for(const h of e){let e=null;switch(h.type){case"path":e=n.createElementNS(nt,"path"),e.setAttribute("d",this.opsToPath(h,a)),e.setAttribute("stroke",s.stroke),e.setAttribute("stroke-width",s.strokeWidth+""),e.setAttribute("fill","none"),s.strokeLineDash&&e.setAttribute("stroke-dasharray",s.strokeLineDash.join(" ").trim()),s.strokeLineDashOffset&&e.setAttribute("stroke-dashoffset",`${s.strokeLineDashOffset}`);break;case"fillPath":e=n.createElementNS(nt,"path"),e.setAttribute("d",this.opsToPath(h,a)),e.setAttribute("stroke","none"),e.setAttribute("stroke-width","0"),e.setAttribute("fill",s.fill||""),"curve"!==t.shape&&"polygon"!==t.shape||e.setAttribute("fill-rule","evenodd");break;case"fillSketch":e=this.fillSketch(n,h,s)}e&&o.appendChild(e)}return o}fillSketch(t,e,s){let n=s.fillWeight;n<0&&(n=s.strokeWidth/2);const o=t.createElementNS(nt,"path");return o.setAttribute("d",this.opsToPath(e,s.fixedDecimalPlaceDigits)),o.setAttribute("stroke",s.fill||""),o.setAttribute("stroke-width",n+""),o.setAttribute("fill","none"),s.fillLineDash&&o.setAttribute("stroke-dasharray",s.fillLineDash.join(" ").trim()),s.fillLineDashOffset&&o.setAttribute("stroke-dashoffset",`${s.fillLineDashOffset}`),o}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,e){return this.gen.opsToPath(t,e)}line(t,e,s,n,o){const a=this.gen.line(t,e,s,n,o);return this.draw(a)}rectangle(t,e,s,n,o){const a=this.gen.rectangle(t,e,s,n,o);return this.draw(a)}ellipse(t,e,s,n,o){const a=this.gen.ellipse(t,e,s,n,o);return this.draw(a)}circle(t,e,s,n){const o=this.gen.circle(t,e,s,n);return this.draw(o)}linearPath(t,e){const s=this.gen.linearPath(t,e);return this.draw(s)}polygon(t,e){const s=this.gen.polygon(t,e);return this.draw(s)}arc(t,e,s,n,o,a,h=!1,r){const i=this.gen.arc(t,e,s,n,o,a,h,r);return this.draw(i)}curve(t,e){const s=this.gen.curve(t,e);return this.draw(s)}path(t,e){const s=this.gen.path(t,e);return this.draw(s)}}var at={canvas:(t,e)=>new st(t,e),svg:(t,e)=>new ot(t,e),generator:t=>new et(t),newSeed:()=>et.newSeed()};
21733
21734
21735 /***/ }),
21736
21737 /***/ 11464:
21738 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
21739
21740 "use strict";
21741 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
21742 /* harmony export */ Z: () => (/* binding */ dedent)
21743 /* harmony export */ });
21744 function dedent(templ) {
21745 var values = [];
21746 for (var _i = 1; _i < arguments.length; _i++) {
21747 values[_i - 1] = arguments[_i];
21748 }
21749 var strings = Array.from(typeof templ === 'string' ? [templ] : templ);
21750 strings[strings.length - 1] = strings[strings.length - 1].replace(/\r?\n([\t ]*)$/, '');
21751 var indentLengths = strings.reduce(function (arr, str) {
21752 var matches = str.match(/\n([\t ]+|(?!\s).)/g);
21753 if (matches) {
21754 return arr.concat(matches.map(function (match) { var _a, _b; return (_b = (_a = match.match(/[\t ]/g)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0; }));
21755 }
21756 return arr;
21757 }, []);
21758 if (indentLengths.length) {
21759 var pattern_1 = new RegExp("\n[\t ]{" + Math.min.apply(Math, indentLengths) + "}", 'g');
21760 strings = strings.map(function (str) { return str.replace(pattern_1, '\n'); });
21761 }
21762 strings[0] = strings[0].replace(/^\r?\n/, '');
21763 var string = strings[0];
21764 values.forEach(function (value, i) {
21765 var endentations = string.match(/(?:^|\n)( *)$/);
21766 var endentation = endentations ? endentations[1] : '';
21767 var indentedValue = value;
21768 if (typeof value === 'string' && value.includes('\n')) {
21769 indentedValue = String(value)
21770 .split('\n')
21771 .map(function (str, i) {
21772 return i === 0 ? str : "" + endentation + str;
21773 })
21774 .join('\n');
21775 }
21776 string += indentedValue + strings[i + 1];
21777 });
21778 return string;
21779 }
21780 /* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ((/* unused pure expression or super */ null && (dedent)));
21781 //# sourceMappingURL=index.js.map
21782
21783 /***/ })
21784
21785 }]);
21786 //# sourceMappingURL=4406.c435ee1d9e07c37b46e4.js.map?v=c435ee1d9e07c37b46e4